WARSAW - Poland's president has signed into law the country's disputed 2017 budget, which was at the centre of an unprecedented parliamentary sit-in staged by opposition MPs who allege it was adopted illegally.

In mid-December, lawmakers from the governing right-wing Law and Justice (PiS) party passed the budget in a room outside the main parliamentary chamber. The move came after liberal Civic Platform (PO) opposition MPs staged an unprecedented occupation of the lower house of parliament over government plans to restrict media access to debates there.

Opposition lawmakers then demanded a re-run of the budget vote, insisting it's adoption breached parliamentary regulations and was therefore "illegal". But the governing party dismissed the allegation and the PiS-controlled Senate passed the disputed 2017 budget on Wednesday. PO leader Grzegorz Schetyna on Thursday appealed to PiS-allied President Andrzej Duda not to endorse the budget, arguing that its validity could be questioned by Poland's partners, including the European Union. PO lawmakers however ended their occupation of parliament earlier the same day after the PiS government withdrew plans to restrict media access to parliament.

The contested budget forecasts that Poland's economy will expand by 3.6 percent this year while spending will comprise 2.9 percent of GDP, just shy of the 3.0 percent of GDP limit required by the EU. But critics warn that the deficit could balloon as the PiS government delivers on its generous social welfare promises, including a new child benefit programme. Poland has been mired in political crisis for months.

In December, the EU gave the PiS government another two months to reverse changes it made to Poland's constitutional court or face sanctions, warning they posed a "substantial" challenge to the rule of law. This and the crisis in parliament come just over one year after the PiS swept to power and began pushing through legislation that critics allege undermines democracy.

Although the moves have sparked mass anti-government street protests, the PiS remains widely supported and has kept well ahead in recent opinion polls due in large part to its generous social spending schemes.