Sri Lanka's former leader has denied allegations that he attempted a coup to try to remain in power after seeing he had lost last week's presidential election.

Mahinda Rajapaksa was widely credited for leaving office peacefully after Thursday's election. But President Maithripala Sirisena's new government has since accused him of convening the chiefs of the police and the army, as well as the attorney general, late Thursday to discuss ways to stop the vote counting, and said Rajapaksa left office only because they didn't cooperate.

The government said it would investigate the alleged incident.

On Tuesday, Rajapaksa tweeted that he denied "in all possible terms reports of attempts to use the military to influence election results."