There was no immediate claim of responsibility for the "green-on-blue" attack - in which Afghan forces turn their weapons on global soldiers with whom they are working.
The US service member killed in an apparent insider attack in Kabul on Saturday had been the mayor of North Ogden in Utah.
Taylor was a Ph.D. candidate at the University of Utah in global relations after receiving a Bachelor of Arts at Brigham Young in political science and a Master of Public Administration from the Unifersity of Utah.
Brent Taylor, had taken leave from his position to serve with the Utah National Guard in Afghanistan and had been part of an advisory team training staff in an Afghan commando battalion in Kabul.
A GoFundMe page has been set up for Taylor's family. Another U.S. service member is being treated for wounds sustained in the attack, American military officials said.
The unexpected death of Taylor, who was months from finishing his tour and is survived by seven children and his wife Jennie, drew an outpouring of grief in Utah and on social media late Saturday.
"Initial reports indicate the attacker was a member of the Afghan National Defense and Security Forces", Resolute Support revealed in an official press release."Initial reports also indicate the attacker was immediately killed by other Afghan Forces".
Denmark urges European Union action on Iran plot
Secretary of State Mike Pompeo in a Twitter post "congratulated" Denmark on arresting what he called "an Iranian regime assassin". Iran's Foreign Ministry strongly denied the plot allegation, calling it part of enemy plans aimed at damaging Iran-EU relations.
'I wish them all the comfort and courage to face the hard days ahead'. "We must rally around his family", he added.
U.S. Senator Orrin Hatch of Utah and the state's lieutenant governor, Spencer Cox, confirmed Taylor's death. The image above was posted last week.
"As the United States of America gets ready to vote in our own election next week, I hope everyone back home exercises their precious right to vote", Taylor wrote.
'"United we stand, divided we fall".
Afghan security force members inspect at the site of an attack in Kabul.
Last month, the North Atlantic Treaty Organisation commander in Afghanistan, General Scott Miller, escaped unhurt when the bodyguard of a provincial governor opened fire on a group of USA and Afghan officials in the southern province of Kandahar.