The man shot on the U.S.-Canada border near Sumas, Washington was in the country illegally and wanted in connection with a murder in another jurisdiction.

That's according to officials for U.S. Customs and Border Protection on Friday.

The agency says the man was approached by two border agents after setting off ground sensors when crossing the border on Thursday afternoon.

The agency says the man displayed "erratic and threatening" behavior toward the agents and sprayed one of them with an incapacitating spray.

The agency says one of the officers then shot and killed the man.

His identity and other details were not immediately released. The agent who was sprayed with the chemical required medical attention but was not seriously hurt.

Sumas is about 100 miles north of Seattle.