SOUTH BRUNSWICK -- A South Brunswick police officer rescued a small dog home alone during a fire at an apartment building on East Garden Way Saturday that left two apartment units damaged and its residents displaced, according to police.

Firefighters and police officers arrived at the scene around 1:30 p.m. where they encountered heavy smoke coming from the building, officials said.

None of the residents of the two connected apartment units on fire was home at the time.

Fire and police officials were unable to gain entry through the front door of one of the units due to the amount of heavy smoke, officials said. So, personnel went around back where Patrolman Brian Luck of the South Brunswick Police Department saw a small dog through a sliding glass door.

Luck was able to open the door and get inside, at which point he retrieved the dog and brought it out to safety, according to police.

The fire was brought under control in about 15 minutes, authorities said.

Luck cared for the dog until its owners arrived home.

The residents of the two apartments units were displaced due to the damage. However, the building's management was making sleeping arrangements for them, authorities said.

The cause of the fire is not known at this time but remains under investigation.

Fire is under control pic.twitter.com/wpvgH24UjY — So Brunswick PD (@SoBrunswickPD) August 20, 2016

Spencer Kent may be reached at skent@njadvancemedia.com. Follow him on Twitter @SpencerMKent. Find the Find NJ.com on Facebook.