BERWICK, Maine — A Berwick fire captain was fatally injured Friday while fighting a four-alarm blaze at a three-story apartment building in Berwick.

Fire officials were visibly shaken and mournful during an information briefing as Maine's state fire marshal, Joe Thomas, his voice cracking, identified the victim from the fire as Capt. Joel Barnes of the Berwick Fire Department.

"Though this is what we do all the time," Thomas said. "For everyone of us in the fire service — when we lose one of our own, it's a difficult time."

In total, more than 16 fire departments from Maine and New Hampshire responded to the March 1 fire at 10 Bell St., according to Tim Wilder, assistant fire chief for the Rochester Fire Department in New Hampshire. Seven fire crews from Maine, 10 from New Hampshire and multiple EMS units assisted.

The fire was first reported at about 11 a.m. at which time Berwick fire and police responded. A second alarm was called at 11:03 a.m., a third at 11:14 a.m. and a fourth and final at 11:31 a.m., convening 50-75 firefighters at the scene.

Asst. Chief Wilder said all of the residents inside of the building at the time of the fire got out safely. As of Friday night, the Red Cross was helping eight people displaced by the multi-family home fire to make sure they have food, a safe place to sleep, and other essentials. Disaster responders are also in contact with two other displaced residents and plan to meet with them Saturday.

Four other firefighters were treated at Wentworth Douglas Hospital in Dover for injuries Friday and were subsequently released.

When asked whether Barnes was one of two firefighters reportedly trapped inside the burning building early on in the fire fight, Wilder confirmed that a mayday call was declared only minutes into the first crews arriving at the scene, but did not comment on specific details about what had happened inside.

Maine Public Safety spokesman Steve McCausland told the Associated Press that Barnes was one of two firefighters who encountered a wall of flames on the third floor and had to be rescued.

"Obviously, you can see this was a difficult situation for all of the fire departments that responded to this event," Thomas said. "I tip my hat to every single one of them for the work that they put into saving their own, trying to make as much progress as possible, and saving any lives of the public who lived there."

Wilder said he had met Barnes before and praised the brave work that led up to the Berwick paramedic's final moments.

"Like anyone in the fire service, their heart’s into it. This is what they do. This is probably the worse thing we could ever do or go through in our careers – something certainly none of us want to do," Wilder said. "But moving forward, we’ll handle it professionally with the courtesy of the family and friends in mind."

Barnes was one of the town's five career personnel members within its fire and rescue department along with fellow Capt. Travis Doiron, an EMT; firefighters Brian Roy and Kyle Lavoie, paramedic and EMT, respectively; and Chief Dennis Plante. Berwick's personnel also consists of 22 on-call and three per diem.

According to the assistant chief of Horry County Fire Rescue in South Carolina, Barnes was a former employee and part of recruit class 26.

"[Captain Barnes] was a very dedicated, passionate and knowledgeable Jake who loved the job! Honored to have had this excellent firefighter as part of the team," Asst. Chief Douglas Cline wrote in a post on Facebook. "RIP brother we have it from here."

RELATED: First responders mourn loss of Berwick Fire Capt. Joel Barnes

In a post on Facebook, the North Berwick Police Department extended its thoughts to Barnes its neighboring department.

"Joel [Barnes] died a hero as he ran towards danger - putting his own safety aside - so that the lives of others may be saved," the post said. "The Men and Women of the North Berwick Police Department extend their deepest sympathies to the Berwick Fire Department, the Town of Berwick, and the friends and family of Captain Joel Barnes."

Prior to first responders' extinguishing of the fire, Berwick Town Manager Steven Eldridge described the apartment building as an older, three-floor apartment building in a residential neighborhood.

The building's roof collapsed during the fire, which had escalated to a four-alarm fire by 11:30 a.m.

An investigation into the origin and cause of the fire was still ongoing.