US President Donald Trump has tweeted his congratulations to Prime Minister Scott Morrison on his “miracle” election win.

The coalition is edging closer to the 76 seats it needs to have a majority in the Australian parliament, with 74 at the end of counting on Saturday night, after a result that defied months of opinion polls consistently showing Labor ahead.

The result has been cheered by conservatives in the US and compared to Mr Trump’s surprise 2016 presidential win when polls had predicted he would lose.

“Congratulations to Scott on a GREAT WIN!” the US president tweeted on Sunday morning, Australian time.