Polish President Andrzej Duda has said he will give incumbent prime minister Mateusz Morawiecki the first opportunity to form a new government following elections three weeks ago.
His Law and Justice (PiS) party won 194 seats and faces a difficult search for allies to reach a majority of 231.
Three pro-opposition parties, led by former PM Donald Tusk, won 248 seats.
If Mr Morawiecki fails to secure enough allies, Mr Tusk could be given the chance to assemble a majority instead.
Mr Morawiecki is the leader of the ruling Law and Justice (PiS) party, which came first in elections to the Sejm, the lower house of parliament, last month but is far short of a majority.
All other parties in parliament have pledged not to support PiS.
Mr Tusk's Civic Coalition (KO) and two allies, the Third Way and the Left, hold a comfortable majority of seats together.
After previous elections, the largest party was given the first opportunity to try to form a government.
Mr Duda, a PiS ally, said in a televised address on Monday night that he had "decided to continue the good parliamentary tradition according to which it is the winning grouping that first gets the chance to form a government".
But given the difficulty Mr Morawiecki would face in securing a majority, the opposition had argued that Mr Tusk should be given the opportunity to agree a coalition.
President Duda added that if Mr Morawiecki failed in forming a government, the task would fall to an alternative candidate, whom he would "immediately appoint" as prime minister.
The decision was immediately denounced by opposition figures. Adam Szlapka, a KO member of parliament, said that Mr Duda's choice was "a waste of time".
The president's choice also signalled that he intended to be a thorn in the side of a potential Tusk-led government. He will be in office until 2025 and has some veto powers he can use against the prime minister.
PiS has been in power since 2015. In that time, Poland has frequently sparred with the EU over issues such as the rule of law and abortion rights.
A total of €36bn (£30bn) of EU funds earmarked for Poland have been blocked by Brussels because of concerns over the PiS government undermining the rule of law.
Earlier this month, Mr Morawiecki said he believed the decision by the Constitutional Tribunal to ban abortion in almost all cases - issued in response to a demand by PiS MPs - was "a mistake".
Parliament has 14 days from being sworn in to hold a confidence vote in a new government.
If Mr Morawiecki fails to win a vote of confidence for his new government, as seems likely at this stage, then parliament itself would designate a new prime minister.