Updated

The man who walked into Comet Ping Pong, a Washington, D.C., pizza shop, armed with an AR-15 assault weapon and a revolver to investigate internet rumors was sentenced to four years in prison Thursday.

Edgar Maddison Welch’s sentence is less than the 4 1/2 years prosecutors had requested, but much more than the 1 1/2 years Welch’s lawyers had pushed for.

Here’s a look at what led Welch to travel to the pizzeria and discharge his weapon.

Oct. 30, 2016

A Twitter account purporting to belong to Jewish attorney David Goldberg — which Buzzfeed calls a “white supremacy” account — claimed that emails from former Democratic presidential nominee Hillary Clinton’s aide Huma Abedin “point to a pedophile ring” — with Clinton “at the center.”

The Twitter account has been suspended.

As the theories go, Clinton and her husband, former President Bill Clinton, were allegedly involved with the operations of an international child sex slavery ring. After the publication of hacked emails from Clinton’s campaign manager, John Podesta, the theory expanded to include him.

HOW AN INTERNET CONSPIRACY LED A GUNMAN INTO A PIZZA PARLOR

Theorists purported that Podesta’s emails contained code language known to pedophiles.

Podesta has exchanged some emails with pizzeria owner James Alefantis, who has fundraising ties with Podesta and other Democrats.

The “Pizzagate” conspiracy theory picked up steam on Reddit and other websites, Time reported. It has been widely debunked.

Even still, Alefantis told Fox News that he and his business were the targets of threatening messages — online and over the phone.

Dec. 4, 2016

Welch walked into Comet Ping Pong armed with a knife, AR-15 assault weapon and a revolver. Welch said that he had driven to the pizzeria from Salisbury, N.C., in order to investigate online conspiracy theories of child sex slaves being held in the restaurant.

Welch fired his gun multiple times when he came upon a locked storage closet.

‘PIZZAGATE’ GUNMAN SAYS IN VIDEO HE’S STANDING UP FOR KIDS

After finding no children held against their will, Welch surrendered to police. He said “that he had read online that the Comet restaurant was harboring child sex slaves and that he wanted to see for himself if they were there,” according to the arrest affidavit.

“[Welch] stated that he was armed to help rescue them,” it said.

No one was injured in the shooting. However, a federal judge said Welch had “literally left psychological wreckage.”

The “Pizzagate” conspiracy theory eventually expanded to claim that Welch, the gunman, was really just a false-flag operation by the Clinton campaign to discredit Donald Trump, the president-elect at the time.

March 24, 2017

Welch pleaded guilty to interstate transportation of a firearm and assault with a dangerous weapon in U.S. District Court in Washington, D.C., the Associated Press reported.

June 2, 2017

In a letter filed with the court, Welch contended that his intent was never to harm anyone at Comet Ping Pong.

ANTI-LGBT DEMONSTRATORS PICKET ‘PIZZAGATE’ RESTAURANT ON INAUGURATION DAY

He said he "came to D.C. with the intent of helping people I believed were in dire need of assistance, and to bring an end to a corruption that I truly felt was harming innocent lives."

"It was never my intention to harm or frighten innocent lives, but I realize now just how foolish and reckless my decision was," Welch wrote.

June 14, 2017

A cell phone video Welch recorded on the way to the Washington, D.C., pizzeria was released. In the video, Welch told his daughters that he loves them as he drove.

"I can't let you grow up in a world that's so corrupt by evil without at least standing up for you, for other children just like you," he said.

Welch added that he wants to protect people who cannot protect themselves.