"David Villa has been discharged from hospital," a short statement from the club's medical team read.
Villa, 31, was first taken into hospital on Monday after having played 90 minutes in a league match for only the second time this season in Sunday's 6-1 win over Getafe, scoring one of the goals.
He was allowed home on Tuesday before being readmitted on Thursday due to "persistent pain caused by nephritic colic", a condition caused by kidney stones, the club said on Thursday.
"The player is definitely out for the match against Granada" away on Saturday in the Spanish league.
Villa spent several months out last year after breaking his left leg in December 2011 and in January spent two weeks recovering from a thigh strain.
Barcelona are flying high at the top of La Liga, 12 points clear of Atletico Madrid in second place and 16 points ahead of their fierce rivals Real Madrid.