Kevin O'Leary's social media accounts posted a video of the Conservative leadership candidate shooting a handgun and several automatic weapons on the same afternoon a public funeral service was underway for three of the six victims of the Quebec City mosque attack.

Then shortly after 3 p.m. ET, he pulled the posts from his social media accounts, saying on Twitter that he did so "out of respect" for the funeral service.

The video had been posted to O'Leary's Facebook page with the caption, "Still got my marksman chops from my days as a military cadet at Stanstead College. Getting up at 5 a.m. was hard but worth it!"

The caption on the video itself features a plug for one of his deals from the Shark Tank reality TV show.

(Facebook)

The Facebook post went online at 12:45 p.m. ET. The public funeral for three of the six people shot to death on Sunday night in a mosque in the suburb of Ste-Foy began 15 minutes later.

While the funeral was underway, O'Leary's Twitter account linked to the same video. The tweet was later deleted.

(Twitter)

Out of respect for today’s service I have taken down my last post. —@kevinolearytv

"We were mistaken in doing the posting of this video on a day we're commemorating and we have the funerals of three of the victims of the shooting in Quebec City," Ari Laskin, a spokesman for O'Leary, said in an interview with CBC News. "We had no intention on showing any disrespect. We regret posting that."

"There's a lot of moving parts … and a lot of different people are working on Mr. O'Leary's campaign," Laskin said, when asked about who was responsible for posting the video.

"I can't really comment on the intent of [the video] because it was done mistakenly."

Laskin said O'Leary was aware the video had been posted.

The receptionist at the Lock & Load Miami: Machine Gun Experience & Shooting Range said she believed O'Leary's visit actually took place several months ago.

The original video was posted to YouTube on March 21, 2016.

'Obviously crass, insensitive'

Previously, O'Leary posted condolences on his Facebook page to express sympathy for those killed.

The morning after the shooting he wrote in French and in English: "Praying for all affected by last night's senseless killings in Quebec City. There are no words to express the pain of a situation like this."

Public Safety Minister Ralph Goodale told reporters on Parliament Hill Thursday that he doesn't comment on the "strange and bizarre behaviour of Conservative leadership candidates."

But when pressed to comment on the timing of the video post, he said "it's obviously crass, insensitive and exceedingly dumb."

When shown the video, International Trade Minister François-Philippe Champagne said in French that he was speechless.

But Liberals weren't the only ones critical of O'Leary's posts.

Mistakes like this will cost us dearly in 2019. <a href="https://twitter.com/hashtag/cpcldr?src=hash">#cpcldr</a> <a href="https://t.co/1cPU6sHgix">https://t.co/1cPU6sHgix</a> —@lraitt

"This was not the right week to talk about that," said Tony Clement, a former leadership candidate who is now supporting Maxime Bernier's campaign.

"I don't think it's appropriate, but Kevin O'Leary has a whole list of those things," said Ontario MP Marilyn Gladu, who has endorsed Andrew Scheer's leadership bid.

'Not a Conservative'

O'Leary's stance on guns had recently been criticized by another leadership candidate.

The day before the mosque shooting, Erin O'Toole put out a news release questioning O'Leary's Conservative credentials and accusing O'Leary of an "attack on firearms owners."

O'Toole's statement said that his rival held "Liberal views" on most issues and "Kevin O'Leary is not a Conservative."

O'Toole pointed to comments O'Leary had made about the AR-15 rifle in a radio interview last summer, describing it as "a weapon that shoots 700 rounds in a minute" and sprays bullets "like a water gun."

During that same interview, which took place in the wake of the Orlando nightclub shootings last June, O'Leary also said, "That is a weapon that is just used to kill everybody in the room you're in. Who should have that? Nobody!"

In his release last weekend, O'Toole called O'Leary's description of the gun "completely false" and said the AR-15 is legally owned by thousands of Canadians.

On Thursday, O'Toole told CBC News that O'Leary's social media posts show "a remarkable lack of judgment."

He also took a shot at the amount of time O'Leary spends living and working in the U.S., saying this episode "shows you have to be in the country to understand the mood of the country."

O'Leary was in New York Thursday, ringing the bell at the New York Stock Exchange to promote one of his business ventures.