Socrates played two World Cups for Brazil. ((Andre Penner/Associated Press))

Former Brazil captain Socrates has left the hospital nearly three weeks after being admitted with internal bleeding.

The 57-year-old Socrates was released after his second stint in the hospital in recent months because of hemorrhage caused by high pressure in the vein that carries blood from the digestive system to the liver.

Socrates has always acknowledged being a heavy drinker, even when he starred as a player in the 1980s.

While in the hospital, he spent several days in an intensive care unit, breathing with the help of a ventilator.

The former playmaker captained Brazil in the 1982 and 1986 World Cups and is a popular columnist and television commentator in the South American country.