An unarmed animal control officer was shot and killed in Sacramento County on Wednesday while trying to retrieve pets from a home whose owner was evicted the previous day.

The officer had gone to the home to rescue dogs and cats authorities thought had been left behind, a day after Joseph Francis Corey was served an eviction notice and a sheriff's deputy changed the locks.

The officer - Roy Curtis Marcum, 45, of Elk Grove - and a bank employee knocked on the door and Corey fired a shotgun through the door, striking the officer in the torso, Sacramento County sheriff's Sgt. Jason Ramos said.

Corey, 65, was arrested early Thursday and faces murder charges after a SWAT team managed to get into his garage after a 17-hour standoff.

"What made him take the actions Wednesday that he didn't take Tuesday when officers had contact with him, who knows?" Ramos said Thursday.

The bank official suffered minor injuries but was not hit by gunfire.

Public records show that Corey, a onetime contractor, owned the home from 2006 until a bank put it into foreclosure in 2011. He filed for bankruptcy protection in 2005 and again earlier this year, according to the Sacramento Bee.

His only income came from disability payments of less than $2,000 a month, according to bankruptcy filings. Among his few possessions he listed in 2005 were a Ruger .22-caliber rifle and six Catahoulas, a breed of dog. Corey had complained to officers on Tuesday that he had nowhere to take the animals.

After shooting the officer, Corey refused to leave the two-story house about 20 miles south of Sacramento, police said, and officers from across the county responded and surrounded the home.

They used tear gas to try to force him out, and eventually, a SWAT team made it onto the garage and arrested him around 5 a.m. Thursday.

He was taken to a hospital as a precautionary measure and was expected to be booked into jail later in the day, Ramos said.

Marcum had been an animal control officer for 14 years, David Dickinson, the county's director of animal control told KCRA-TV. Dickinson said Marcum had helped out numerous times removing animals in homes after eviction notices before he was killed.

In Sacramento County, animal control officers are not sworn officers, so they are not armed.