The UNP said that it was decided during the discussion that Wickremesinghe will take oaths as Prime Minister on Sunday morning.
An official at the president's office confirmed that Wickremesinghe would be sworn in, which should help achieve parliamentary approval for a temporary budget that is required by January 1.
Rajapaksa is expected to deliver an address to the nation later Saturday in which he is expected to explain his resignation.
After winning the election, he formed a government with Wickremesinghe as prime minister, but the two leaders started to have differences over economic policy and the investigations of alleged wartime abuses.
But Wickremesinghe refused to step down insisting that his sacking was illegal, leaving the Indian Ocean nation of 21 million people with two men claiming the premiership.
His surprise sacking by President Maithripala Sirisena plunged Sri Lanka into a political crisis.
Mr Rajapaksa said in a statement: "Since I have no intention of remaining as prime minister without a general election being held, and in order to not hamper the president in any way, I will resign from the position of prime minister and make way for the president to form a new government".
Rajapaksa, 73, had sought to secure a majority in the 225-member Parliament but failed.
Today I Discovered Why Searching Google For 'Idiot' Show Trump
He decried the company's dominance, saying it could sway the nation's political future. He continued: "I'm confident we don't approach our work with any political bias".
He said Wickremesinghe's ministers were responsible for alienating the country's powerful Buddhist monks from the government by having them arrested for holding in their temples unlicensed captive elephants. Sirisena then dissolved Parliament and called snap elections on January 5.
According to media reports, a new Cabinet will be sworn in on Monday.
However, the Supreme Court overturned his decision and halted the preparations for snap polls.
Wickremesinghe had not looked into prosecuting former rebels whom he said were hiding in foreign countries while having only government soldiers arrested, Sirisena said.
Sirisena suffered a huge setback when the highest court in the country ruled last week that he acted outside the constitution when he sacked parliament in early November.
President Sirisena was once a party ally of Mr Rajapaksa, and served in his government.
Sirisena's disputed appointee had pressed ahead, forming a purported government and naming a cabinet even as parliament cut off state funds to his office.
He said he had planned to "prevent this country from becoming another Greece".