Canadian voters have reclaimed their country's liberal identity sending Justin Trudeau to the prime minister's office and ending 10 years of conservative leadership under Stephen Harper.

The victory in by Mr Trudeau's Liberal Party was stunning. The Liberals were on a path to win at least 184 seats out of 338 - a parliamentary majority that will allow Mr Trudeau - the son of one of the country's most dynamic politicians - to govern without relying on other parties.

The Liberals received 39.5 per cent of the overall vote compared to 32 per cent for the Conservatives and 19.6 per cent for the New Democrats.

Mr Harper, one of the longest-serving Western leaders, will step down as Conservative leader, the party announced as the scope of its loss became apparent.

Mr Trudeau's victory could result in improved ties with the US, at least for the remainder of Barack Obama's presidency.

Mr Harper was frustrated by Obama's reluctance to approve the Keystone XL pipeline from Alberta to Texas and clashed with the president on other issues, including the Iran nuclear deal.

Mr Trudeau is the son of the late prime minister Pierre Trudeau, who swept to office in 1968 on a wave of support dubbed "Trudeaumania". He was prime minister until 1984 with a short interruption and remains one of the few Canadian politicians known in America, his charisma often drawing comparisons to John F Kennedy.

Mr Trudeau channels the star power - if not quite the political heft - of his father.

"Tonight Canada is becoming the country it was before," Mr Trudeau told a victory rally in Montreal.