LAGOS, Nigeria — Gunmen ambushed two Americans and two Canadians traveling through the Nigerian state of Kaduna, kidnapping them and killing two police officers, a state police spokesman said Wednesday.

The visitors were heading south from Kafanchan in Kaduna to the capital, Abuja, on Tuesday night when they were ambushed around Kagarko, the Kaduna state police spokesman, Mukhtar Aliyu, said.

“The two police escorts attached to them engaged the kidnappers in a fierce gun battle, which resulted in the unfortunate death of the two police officers,” Mr. Aliyu said.

The Americans and Canadians are investors setting up solar stations in villages around Kafanchan, Mr. Aliyu said.