Senetor Orrin Hatch, R-Utah, called Taylor a "hero, a wonderful father and a dear friend." Utah Gov. Gary Herbert said he was "heartbroken."
"This is a sad day for Utah, for America," Herbert said. "He was the personification of love of God, family and country."
Hatch on the death of North Ogden Mayor Brent Taylor:
“Brent was a hero, a patriot, a wonderful father, and a dear friend. News of his death in Afghanistan is devastating. My prayers and love are with Jennie and his 7 young children. His service will always be remembered.” pic.twitter.com/UHHbhTciYo
Taylor had left his position in North Ogden, a city of around 17,000 people about 45 miles (70 km) north of Salt Lake City, earlier this year to serve in Afghanistan. It was his fourth deployment, according to The Deseret News, a Utah newspaper.
The NATO-led mission in Afghanistan said in a statement on Saturday that a US armed forces member was killed but did not identify him.
"Initial reports indicate the attacker was a member of the Afghan National Defense and Security Forces. Initial reports also indicate the attacker was immediately killed by other Afghan Forces," the mission said in a statement.
The attack was the latest in a series of "green-on-blue" incidents in which members of the Afghan forces have killed US or coalition advisers this year, and it followed the death of a Czech soldier in the western province of Herat last month.
US Defense Secretary James Mattis said in September that training and vetting of Afghan forces was being stepped up to minimize such attacks, and that some training and advisory operations have been scaled back while security is assessed.
Last month, the NATO commander in Afghanistan, General Scott Miller, escaped unhurt when the bodyguard of a provincial governor opened fire on a group of US and Afghan officials in the southern province of Kandahar.
A week ago, Taylor urged Americans to vote in Tuesday's congressional elections, saying he hoped "whether the Republicans or the Democrats win, that we all remember that we have far more as Americans that unites us than divides us."
The attack was the latest in a series of 'green-on-blue' incidents in which members of the Afghan forces have killed US or coalition advisers this year.