DUBLIN 
A High Court judge ruled Wednesday that Ireland's government should stop delaying a by-election for a parliamentary seat left empty for 17 months, a judgment that further weakens the ability of Prime Minister Brian Cowen to stay in power.

Cowen's unpopular government has blocked by-elections in three Irish constituencies because it expects to lose all three. As it is, Cowen barely retains a parliamentary majority needed to pass emergency deficit-slashing measures in December.

The mood is darkening on the streets in anticipation of widespread cuts and tax hikes expected to exceed euro4.5 billion ($6.2 billion).

As Cowen faced questions inside parliament about whether he would call an early election, an estimated 25,000 students marched to the gates outside in protest at plans to introduce hefty new university fees.

Many protesters wore T-shirts calling for "Education, not emigration" - referring to a recent surge of young people leaving Ireland's double-digit unemployment for opportunities from Canada to Australia.

While the main protest by the Union of Students in Ireland was peaceful, hundreds jostled with riot police on foot and horseback afterward.

Police and witnesses said students threw bricks, placards and eggs at the Department of Finance, and about 20 stormed into the lobby before being wrestled back out. Hundreds more staged a sit-down protest in the roadway. Police said several protesters were injured, and several more arrested.

Earlier, High Court Justice Nicholas Kearns sent shock waves through the government with his surprise judgment that Cowen was violating the constitutional rights of voters and political candidates by leaving a parliamentary seat empty for so long. Government lawyers had argued that the government wielded sole power to determine when, if ever, by-elections were held.

Kearns, the senior judge on Ireland's second-highest court, said the failure to hold a prompt by-election "offends the terms and spirit of the constitution and its framework for democracy."

One of three lawmakers' posts for Donegal South West has been empty since June 2009 when the incumbent, a member of Cowen's long-ruling Fianna Fail party, left to take a seat in the European Parliament.

Cowen needs every vote. He currently can depend on just 82 lawmakers in a Dublin parliament run down to 161 members. Failure to pass the 2011 budget after its Dec. 7 publication would trigger an early national election.

On Tuesday, Cowen's parliamentary bloc suffered another casualty with the surprise resignation of Fianna Fail lawmaker Jim McDaid. He published a letter to Cowen accusing him of preferring to cling to power than to make tough decisions, and appealed for an election now.

Doherty, whose Irish nationalist Sinn Fein party opposes the budget cuts, is favored to win the Donegal South West seat.

Cowen told lawmakers it would be "premature" to offer any detailed response to the judgment until government lawyers could study it. His government's junior coalition partners, the Green Party, said they wanted the Donegal vote organized immediately.

Analysts unanimously agree that Cowen will lose his parliamentary majority whenever the outstanding by-elections for Donegal South West, Dublin South and Waterford are held. The latter two constituencies have had vacancies since February and March, respectively. Governing parties rarely win by-elections, and Cowen's government has fallen to historic lows in polls.

A Fianna Fail lawmaker, speaking to The Associated Press on condition of anonymity because he wasn't authorized to discuss government plans, said the government would permit the Donegal South West vote soon but keep delaying the other two.

He dismissed the chance that the government would appeal Wednesday's judgment to the Supreme Court, arguing this would cause further damage to Cowen's public standing while having little chance of reversing the verdict.

Ireland this year is expected to record the worst deficit in modern European history, 32 percent of GDP, and has been ordered by European Union leaders to slash the deficit back to the euro-zone limit of 3 percent by 2014.

Uncertainty over Ireland's capacity to keep paying its bills amid recession and a euro45 billion ($62 billion) bank-bailout program has fueled a surge in the costs of Irish borrowing on international markets. The interest rates on Irish 10-year bonds continued to hover Wednesday near 7.4 percent, a euro-era high reached the day before.