A two-alarm fire on Bowdoin Street in Dorchester on Thursday yielded a heroic rescue for two residents who escaped the blaze.

Eliezer Perez, the owner of a barber shop across the street from the scene of the fire, said he had stepped outside and noticed the flames.

“I was here at the front of the barber shop and we were talking on the phone when I looked outside and I saw a huge fire so I told my friends here at the shop to look at the fire,” Perez said in Spanish. “When we went outside we saw two older people on the second floor … We told them we would help them and we told them to jump so we helped the woman jump and we didn’t let her fall. Afterwards we told the man to jump, too, but he went back to get his iPad or something and then came back so then we helped him off the roof, too. He had fainted so we grabbed him and brought him out … We took him out of the flames and he was breathing better.

“If that man stayed a few more minutes he would have died from taking in too much smoke.”

In a video taken by Perez, the man is seen being escorted away from the building and lying on the sidewalk while neighbors crowd around and fan air near his face.

Firefighters responded to the home around 4 p.m. on Thursday. Thick smoke and flames poured from the roof, front door and windows.

Perez’s friend, Alfred Jimenez, climbed atop the roof of the building and quickly grabbed the man and woman out of the window and helped them to safety.

“I saw the smoke and I knew the building was burning so we went out and I was worried because we saw people in danger so I went up to the roof and I saw the woman by the window … I helped the woman first and then the man … I grabbed them out of the window and put them down,” Jimenez said in Spanish.

“I feel good because I helped someone in need. In the moment I was only thinking that they were older people and I didn’t want anything to happen to them,” said Jimenez.

Perez and Jimenez said they had seen the man and woman around the neighborhood before, motivating them to jump into action.

According to the Boston Fire Department, the two residents were taken to the hospital with minor injuries.

The blaze resulted in about $500,000 in damages. The cause is still under investigation.