A federal customs inspector shot and killed an apparently unarmed man who accosted him while he was seated in a parked car on a Brooklyn street early yesterday, police said.

The bizarre violence in Bushwick – which neighbors speculated was sparked by a misunderstanding over the car – left 31-year-old Wilson Alba dead and sent U.S. Customs and Border Protection Inspector Martin Carrington to the hospital with chest pains.

Police believe Alba either was trying to rob Carrington or carjack him.

No charges have been filed, but the shooting is under investigation by the Brooklyn district attorney.

Carrington, 38, spent three years as a U.S. Immigration and Naturalization Service in spector before that agency was made part of customs.

Alba, who has a record of drug arrests, leaves a girlfriend and two children, a friend said.

“It doesn’t make sense to me,” said the friend, who asked that his name not be printed. “I don’t understand why he shot him.”

Police said no weapon had been found on Alba.

Carrington, who lives near the shooting scene, was released yesterday from Bellevue Hospital.

Cops said Carrington worked overtime past his shift at JFK Airport on Saturday, left at about 1 a.m. and stopped to get takeout food on his way home to Bushwick.

Police said Carrington opened his car door and reached over the seat to grab his food, and at that point Alba – also a Bushwick resident – came running down the street screaming in Spanish.

Cops said Carrington does not understand Spanish.

Angela Matus, who lives across the street, speculated that Alba had thought Carrington was sitting in another car – the Toyota parked in front of Carrington’s.

That theory was supported by a man who said his friend witnessed the encounter. The man quoted his friend as saying that Alba was drunk and confused about which car was his and went to open Carrington’s car door.

It is not known if Alba had some kind of connection to the Toyota parked in front of Carrington’s car. That Toyota is registered to an Inwood, L.I., woman.

Police said Alba grabbed Carrington around the neck and dragged him out onto the street, where they struggled.

Alba let him go after a bit, and Carrington pulled his licensed 9 mm pistol and fired a round at Alba, who then lunged at him again, cops said. Carrington, thinking that he had missed Alba the first time, pumped off a second round, police said.

Alba was hit by both shots, according to police.

Cops arrived within minutes and took Alba to Elmhurst General Hospital, where he was pronounced dead at 4:23 a.m.