Image copyright Getty Images Image caption From left: Justin Trudeau, Andrew Scheer and Jagmeet Singh

Canadians are heading to the polls to vote in a general election, with Prime Minister Justin Trudeau's Liberals hoping to hold on to their majority.

But that outcome appears unlikely as polls suggest the result of the vote is headed towards a hung parliament.

The Liberals have been deadlocked with their centre-right Conservative rivals.

Over 27 million people are registered to vote in the race for control of Canada's 338 seat House of Commons.

Approximately 4.7m Canadians voted in early polls last weekend, according to Elections Canada - a 29% increase from votes cast in advance in the 2015 general election.

Mr Trudeau's Liberals had a historic victory in that election, taking 184 seats.

Media playback is unsupported on your device Media caption What do Canadians think of Trudeau's record?

It was a stunning upset for the party, which leapfrogged from third place to defeat the Conservatives, who had been in power for nearly a decade.

The Liberal leader had a long honeymoon with Canadians, but in the last two years in office his popularity was hit by a string of scandals, including ethics rules violations.

During the campaign he also had to defend his past behaviour when images of him wearing blackface, as recently as 2001, were made public.

The BBC's Jessica Murphy on what's at stake

By most measures this has been a divisive campaign.

Justin Trudeau, who in his 2015 victory speech called Conservatives "neighbours" and urged unity, spent much of this campaign warning that if given the chance, his political foes would bring in regressive policies and harsh austerity measures.

He accused the Conservatives of running "one of the dirtiest, nastiest campaigns" on record in Canada.

Conservative leader Andrew Scheer deemed Mr Trudeau "a phony" and "a fraud" during a national TV debate and accused the Liberals of "making up lies" about his policies.

Potentially damaging past statements, social media posts and transgressions by candidates were dredged up and made public.

But amid all that came policy pitches on defining challenges like the impact of climate change and the future of the oil and gas industry, and spending promises on social issues like pharmacare and affordable housing - and vastly different visions of Canada's future.

His main rival is Conservative leader Andrew Scheer, who centred his campaign on pocketbook issues but also faced scrutiny over where his party stands on social issues like abortion.

Climate change, the economy, and healthcare were also on voters' minds during the five-week campaign.

Media playback is unsupported on your device Media caption Four years of Justin Trudeau in two minutes

In third-place in national polls is the NDP led by Jagmeet Singh, the first person of colour to head a major federal party in Canada.

The left-wing party has seen a late surge in the polls - as has the sovereignist Bloc Quebecois in Quebec, the only province where it runs candidates.

Canada's Green Party is also hoping to win a handful of seats this election.

More on Canada's election: