A man suffered second and third degree burns to his legs and feet after an explosion at Nanaimo's tent city early Friday morning.

Officials say the incident happened around 2:40 a.m. at the encampment dubbed DisconTent City, on the city's downtown waterfront.

A representative of tent city who did not want to be named tells CTV News the individual who was injured was in the process of making a pipe bomb.

The explosion was ignited by a discarded cigarette, but it did not spark a fire.

The injured man’s girlfriend was asleep in the tent at the time and suffered from shockwaves from the blast, according to the rep.

A video posted to Facebook shows the aftermath of the terrifying incident.

A man can be heard screaming in pain as police and paramedics arrive at the encampment. Witnesses say he was carried to an ambulance shortly after.

Nanaimo’s fire chief says this is exactly the sort of problem they’ve been worried about.

“We have very vulnerable people living within tent city and a lot of risky behaviour is conducted in tent city,” said chief Karen Fry.

"Tent City residents awoke in confusion. A group of residents extinguished the flames and set up a perimeter (fearing of a second explosion)," said Shea O'Grady, who filmed the video, in a Facebook post.

He described the blast as "earth-shaking," and said tent city residents argued among themselves in the ensuing confusion.

Tensions were running high at the encampment. A man was arrested after throwing rocks at members of the media.

Fire officials were expected to head back to tent city Friday to investigate the cause of the explosion.

The fire department and the city are awaiting a judge’s decision within the next few weeks on what should happen next with the encampment.