SUMAS, Washington — A man fatally shot on the U.S.-Canada border about 100 miles north of Seattle apparently was in the country illegally, a U.S. Customs and Border Protection official said Friday.

A preliminary investigation shows the man was also wanted for a murder outside Whatcom County, Washington, where Thursday's shooting occurred, Sheriff Bill Elfo said. But Elfo did not provide any details about the murder case.

The man was approached by two Border Patrol agents after setting off ground sensors along the border into the United States on Thursday afternoon near the town of Sumas, said Dan M. Harris Jr., chief Border Patrol agent for the Blaine sector.

The man was "suspected of having illegally crossed the border," Harris said.

After displaying erratic and threatening behavior toward the agents and refusing to follow their orders, the man sprayed one of them with an incapacitating spray, Harris told a news conference.

One of the agents then shot and killed the man, who was later identified by the Whatcom County medical examiner as Jamison E. Childress, 20. No hometown was given.

The agent who was sprayed with the chemical required medical attention but was not seriously hurt, Harris said. The agency was trying to determine what type of spray was used.

"People cross the international border to bring crime and violence to our communities," Elfo said.

A multiagency task force, including the sheriff's office, will investigate the shooting.

Officials released few details at the news conference, saying the investigation was in the early stages.

A hatchet was found in the man's backpack, but it was not displayed at the agents, Elfo said. "It was apparent he was erratic and aggressively approached the agents," he said.

The two agents involved have 10 and 19 years of service, respectively, with the border agency. They were not identified Friday.