SAN FRANCISCO (AP) — The man accused of attacking former U.S. House Speaker Nancy Pelosi’s husband with a hammer apologized Tuesday, echoing right-wing conspiracy theories to explain to jurors that he went to the Pelosis’ home as part of a bigger plot to end what he viewed as government corruption.

David DePape spoke for more than an hour in which he tearfully recounted about how his political leanings went from leftist to right wing after reading a comment on a YouTube video about former President Donald Trump. He said he bludgeoned Paul Pelosi after realizing his larger plan might be unraveling.

Testimony wrapped up later Tuesday, with closing arguments expected Wednesday. DePape has pleaded not guilty to attempted kidnapping of a federal official and assault on the immediate family member of a federal official with intent to retaliate against the official for performance of their duties. His attorneys argue that he was not seeking to go after Nancy Pelosi because of her official duties as a member of Congress and so the charges do not fit.

The attack happened in the early hours of Oct. 28, 2022, just days before the midterm elections.

DePape, 43, said he went to the Pelosis’ home to talk to Nancy Pelosi about Russian involvement in the 2016 election, and that he planned to wear an inflatable unicorn costume and upload his interrogation of her online. Prosecutors say he had rope and zip ties with him.

DePape testified that his plan was to get Nancy Pelosi and other targets to admit to their corruption. “If she lied, I would break her kneecaps,” he said. “The choice is on her.”

He then wanted President Joe Biden to pardon the targets “so we can move forward as a country,” he said.

In testimony Monday, Paul Pelosi recounted the attack publicly for the first time. He recalled being awakened by a man bursting into the bedroom door and asking, “Where’s Nancy?” He said that when he responded that his wife was in Washington, DePape said he would tie him up while they waited for her.

Paul Pelosi said he managed to call police, but when officers arrived, DePape hit him with a hammer. He said DePape told him he was going to have “to take you out.”

DePape said that he felt bad for Pelosi after hearing testimony from a neurosurgeon who operated on him after the attack and testified Pelosi had two wounds on his head, including a fracture to his skull that had to be mended with plates and screws. Pelosi also needed stitches on injuries to his right arm and hand.

“He was never my target and I’m sorry that he got hurt,” DePape said.

“I reacted because my plan was basically ruined,” he said when asked why he hit Pelosi.

DePape testified he first was drawn to right-wing conspiracies after learning about “Gamergate,” an online harassment campaign against women in the video gaming community that took place about a decade ago. He said he often played videogames for up to six hours a day while listening to political podcasts.

He said he believed news outlets repeatedly lied about Trump, and specifically mentioned CNN. In rants posted on a blog and online forum that were taken down after his arrest, DePape echoed the baseless, right-wing QAnon conspiracy theory that claims the U.S. government is run by a cabal of devil-worshipping pedophiles, but he did not mention that Tuesday.

He allegedly told authorities his other targets included a women’s and queer studies professor at the University of Michigan, California Gov. Gavin Newsom, actor Tom Hanks and President Joe Biden’s son Hunter. He told jurors that he heard about the professor while listening to conservative commentator James Lindsay.

“The takeaway I got is that she wants to turn our schools into pedophile molestation factories,” said DePape, a Canadian citizen who moved to the U.S. more than 20 years ago.

The professor testified that some of her writings have been misconstrued to fit a narrative against the gay movement. U.S. District Judge Jacqueline Scott Corley ordered her name not be put in the public record because of threats against her.

Asked by DePape’s defense attorney if she supported the abuse of children, the professor responded, “Absolutely not.”

She said that after Paul Pelosi was attacked, the FBI informed her that she was DePape’s main target. She said that she told university administrators and that they have taken measures to protect her, her students, and other staff.

Other witnesses who testified Tuesday included Daniel Bernal, Nancy Pelosi’s San Francisco chief of staff, and DePape neighbor Elizabeth Yates, who said she allowed him to shower at her home once a week.

If convicted, DePape faces life in prison. He has pleaded not guilty to charges in state court of attempted murder, assault with a deadly weapon, elder abuse, residential burglary and other felonies. A state trial has not been scheduled.