Madrids La Paz hospital said the 51-year-old Spaniard was in stable condition. He will have more tests to determine what made him lose consciousness on Monday.
Ballesteros said he was feeling well in a message written on his Web site on Thursday.
He was admitted to a hospital last year, and doctors discovered an irregular heartbeat. It is unknown whether that condition is linked to his problem.
Ballesteros, a five-time major champion, had a long history of back pain before retiring in 2007.
He won the British Open three times and the Masters twice, and had 50 victories on the European Tour.