After a black man was shot seven times in the back by a police officer in Kenosha, Wisconsin, on Sunday, 23 August, people angry about police violence began protesting.
On the third night of demonstrations, a 17-year-old boy allegedly fired on protesters with a military-style semi-automatic rifle, killing two and seriously injuring a third.
On Wednesday he was arrested at his mother's home in Antioch, Illinois, some 30 minutes from Kenosha. A day later he was charged with one count of first-degree intentional homicide and one count of first-degree reckless homicide.
Videos indicate he spent hours on Tuesday apparently helping patrol the streets. He told journalists it was his "job" to guard buildings and even offer medical assistance to protesters.
Here's what we know about the teenager, and his connections to a Donald Trump rally and a Facebook group reported for inciting violence.
Who is he?
Details are still emerging about Kyle Rittenhouse, but his social media profiles show a fascination with police dating back several years.
A Facebook photo of him was framed with the "Blue Lives Matter" logo - a staunchly pro-police movement that often clashes with Black Lives Matter supporters.
Several of his posts honoured police officers killed on duty, and he also posted pictures of himself wearing full police uniform. He is a former member of a local police cadet programme, Grayslake Police Department says.
Guns are another of his passions. Photos show him posing with weapons, practising target shooting and assembling a rifle.
One of the charges brought against him is possession of a dangerous weapon by a person under 18.
In an interview on Tuesday night before the shootings, he echoes police language when telling a journalist why he is armed.
"Part of my job also is to protect people. If someone is hurt, I'm running into harm's way," he says.
He is captured on video at different times during that night. At one point, he speaks to police who offer him water.
Later, he is shown being pursued by a group of people, one of whom appears to fire into the air. The teenager turns to see where the sound is coming from as another person tries to attack him. At that point, the teenager appears to shoot the man, later identified as Joseph Rosenbaum.
Fleeing momentarily, he finds himself chased by a crowd before falling to the ground, and firing his gun. One of those hit by the gunfire falls to the ground, fatally injured. He is later named as Anthony Huber.
Another person runs away apparently injured. Many shots are heard during this incident.
According to the New York Times, the person who runs away injured is carrying a handgun and CBS Chicago quotes prosecutors as saying the injured man "appeared to have a handgun in his right hand when he was shot".
After this second shooting, Kyle Rittenhouse heads towards police vans with his arms in the air. A bystander shouts, "that dude just shot them", but the police vehicles pass by to attend to the injured protesters.
Who were the victims?
Mr Rosenbaum, 36, was from Kenosha, and Mr Huber, 26, was from Silver Lake. The injured man has been named as Gaige Grosskreutz, 26, from West Allis.
They were on Kenosha's streets on a tense night that saw protesters clash with police and armed vigilantes.
Demonstrators are angry about another police shooting of a black American weeks after the US was engulfed by a huge movement calling for an end to racism and police brutality.
Jacob Blake, 29, was shot seven times in the back by officer Rusten Sheskey while getting into his car with his children on Sunday. His lawyer says it will be a "miracle" if he walks again.
Limited law enforcement in Kenosha has led to individuals and groups taking the law into their own hands during the unrest, a spokesman for the Wisconsin Professional Police Association told the BBC.
Videos from Tuesday show armed civilians in military clothes congregating outside buildings in the city.
What are the alleged shooter's connections to Donald Trump?
The suspect's social media accounts suggest he is a supporter of President Donald Trump.
Video shows him cheering in the front row of an Iowa rally for the president's re-election campaign. He also posted video from the event on his TikTok account.
His Instagram profile bio read "Trump 2020".
A spokesperson for Mr Trump told BuzzFeed News that the teenager had "nothing to do with our campaign".
"President Trump has repeatedly and consistently condemned all forms of violence and believes we must protect all Americans from chaos and lawlessness [...] We fully support our fantastic law enforcement for their swift action in this case," they added.
Is there a connection to a militia Facebook group?
Before the protests, a Facebook group called Kenosha Guard issued a "call to arms" to its members.
Members reportedly discussed what weapons and what type of damage to inflict on protesters' cars.
Several users warned Facebook that the group was inciting violence but were told the post did not violate the platform's standards, reports the Verge.
It was eventually removed after the shootings on Tuesday night.
"At this time, we have not found evidence on Facebook that suggests the shooter followed the Kenosha Guard page or that he was invited on the event page they organized," Facebook told the Verge.
What's the reaction?
More than 200 FBI agents are being sent to Kenosha to try to bring order to the city, and the White House says 2,000 National Guard members are available to go.
Right-wing Fox News presenter Tucker Carlson sparked uproar on Wednesday when he appeared to justify the shootings.
"How shocked are we that 17-year-olds with rifles decided they had to maintain order when no-one else would?" he said on his TV show.
He said Kenosha had descended into "anarchy" after being "abandoned" by authorities.
He was swiftly condemned on social media.
"An innocent black guy is killed by police and Tucker Carlson calls him a thug. A guilty white guy murders two people and Tucker Carlson calls him a patriot," tweeted CNN commentator Keith Boykins.
Meanwhile a viral rumour claiming that protesters fired a Molotov cocktail at the alleged shooter has been debunked.
Some claimed the video suggested the suspect was acting in self-defence, but other footage from the scene showed that in fact the protester threw a bag.
Correction 9th October: This article was amended in the hours after publication to give a more detailed account of the sequence of events and make clear that Kyle Rittenhouse was seen on video being pursued by a group of people before the first shooting.