Kevin O'Leary is dropping out of the Conservative leadership race and will endorse Maxime Bernier.

The businessman and reality TV star is ending his campaign only hours before the last leadership debate in Toronto, and two days before party members can start casting their ballots.

O'Leary is confident he could win the Conservative race, but now believes he cannot defeat Prime Minister Justin Trudeau in the next election, multiple sources tell CBC News.

He has cited his failure to gain traction in Quebec and his poor French-language skills as reasons for dropping out of the leadership race.

"I have extremely high likelihood of winning the leadership race, but no way to win the election because of Quebec," he said in an interview with the Globe & Mail on Wednesday. "You have to win 30 seats. So, who can do that? It’s Bernier."

"He’s a front-runner," O'Leary said. "I like Max. I can work with him."

'Worked like hell'

In a statement sent to reporters, O'Leary said he has "worked like hell on this campaign."

"This was not an easy decision for me to make but after much thought and deliberation, it is the right one for the Conservative party and the country," he said. "I want the DNA of my policies and objectives to survive into the general election. The candidate that best mirrors my policies is Maxime Bernier."

Bernier will hold a press conference at 4:30 p.m. ET in Toronto to discuss the developments. CBCNews.ca will carry it live.

O'Leary has spent the better part of his relatively short campaign — he entered the race in January — taking jabs at Trudeau, branding the prime minister "surfer dude" and calling his leadership a "disaster" for the country. He has also said Trudeau negotiating with U.S. President Donald Trump is like "Bambi versus Godzilla."

O'Leary has not left his Conservative opponents unscathed, and, despite his endorsement of Bernier, the two candidates have sparred over allegations of membership fraud and vote buying. The Quebec MP called O'Leary a "loser" after he went public with concerns about vote rigging.

The former Dragons’ Den star, who now appears on the American show Shark Tank, has attracted considerable media attention, and polls had pegged him to be the candidate with the most votes on the first ballot.

Bernier has been a close second in those same polls and O'Leary’s endorsement could give him a significant advantage over the 12 other candidates still in the race.

The Boston-based pitchman has signed up some 35,000 members, largely based on his personal appeal and his promise to kill the national carbon tax, cut red tape and "unbridle" Canada’s natural resources.

O’Leary has been accused of not taking the leadership race seriously. During the campaign, he has spent many days in the U.S., selling his wares on QVC and offering commentary on U.S. cable networks.

The decision comes only three hours after his campaign team sent a fundraising email — signed by O'Leary himself — to supporters.

"The last leadership debate is tonight, and it’s your last chance to join our big fundraising push before I go on stage," the email said. "My team will be showing me a list with the names of those who donated. I need your name to be on that list. I want to know you're in my corner. I’m fired up, and I know you are too."

The federal Conservatives will elect their new leader on May 27.