Gyurcsany, two lawmakers from his Democratic Coalition and about a dozen lawmakers from Politics Can Be Different were taken away in police vehicles when security officials broke up the protest in which politicians chained themselves to pillars at the legislature's car entrances.
Police also detained Attila Mesterhazy, the leader of the Socialist Party, the largest opposition group, and other party leaders who tried to prevent police from detaining the other politicians.
The protest was organized by Politics Can Be Different, the smallest faction in Parliament, which announced a "new opposition" to the regime of Prime Minister Viktor Orban.
Gyurcsany was released early Friday afternoon.
"My detention was a total absurdity," Gyurcsany told the AP by phone. "I was not an active participant in the protest and I was there simply to express my solidarity with the successful LMP action," he said in reference to the Hungarian acronym for Politics Can Be Different.
Gyurcsany, who broke away from the Socialists and formed his own party earlier this year, resigned as prime minister in 2009, a few months after Hungary was forced to ask the International Monetary Fund and other lenders for a standby loan of euro20 billion ($26 billion) to avoid bankruptcy.
In September 2006, weeks of protests and rioting took place after the broadcast of a secret speech by Gyurcsany to Socialist lawmakers in which he admitted lying about the economy to win the elections.
Inside Parliament Friday, government lawmakers were in the process of approving several contentious laws, including a new central bank law that has drawn criticism from the European Union because it could limit the independence of the National Bank of Hungary led by Andras Simor, who has come under frequent attacks from Fidesz, Orban's party which has a two-thirds legislative majority.
One of the most disputed plans would open the way for the merger of the central bank with Hungary's financial regulator, diminishing the authority of the central bank's president.
Other laws on Friday's agenda included a new electoral law, which critics say could give Fidesz an unfair advantage, and a so-called "stability law" which would entrench the new flat income tax and make it very difficult for future governments to change the tax code.