"The attackers took over a building near the governor's office and police headquarters", Badghis Governor Abdul Ghafoor Malikzai told the AFP news agency.
Meanwhile, the Ministry of Interior spokesman Nasrat Rahimi said a group of 3 suicide bombers launched the attack on a hotel in the city at around noon time.
Officials said two of the gunmen were killed and one suspect had yet to be apprehended.
Between January and March this year, air operations by Afghan and global forces have caused at least 145 deaths, accounting for almost 25 percent of the total deaths during that period, UN Assistance Mission in Afghanistan (UNAMA) said in its quarterly report in April. Police said the attack targeted Malik Toor, a pro-government militia commander, who was killed in the blast.
The Resolute Support mission gave no further details and withheld the name of the service member until the next of kin were informed.
American officials have expressed a desire to reach a peace deal by September 1, ahead of Afghan presidential elections scheduled for later that month.
The soldier is the 10th member of the United States military to be killed this year - compared to 12 in all of 2018. The statement also said the identities of the soldiers would not be released.
Talks between Khalilzad and the Taliban have focused on USA and North Atlantic Treaty Organisation troop withdrawal and guarantees from the Taliban that Afghanistan would not again become a safe haven for terrorists to plan a global attack like 9/11.
The event comes days after the seventh round of talks between USA and Taliban representatives concluded in Doha, Qatar, which focused on the withdrawal of US troops and a permanent cease-fire.
"While we've made clear to the Taliban that we are prepared to remove our forces, I want to be clear we've not yet agreed on a timeline to do so", Pompeo said.