Residents of Farah, capital of the province of the same name, have warned for months the city was vulnerable and the attack appeared to threaten a repeat of the Taliban's capture of the northern city of Kunduz, which fell briefly in 2015.
Attackers overran several security checkpoints in the city, and heavy fighting was under way on Tuesday, provincial official Fared Bakhtawer said.
But the defence ministry said the army had repulsed the attack and that "security forces are now chasing the enemy".
Zabihullah Mujahid, a Taliban spokesman, claimed responsibility for the attack. He said fighters launched attacks from multiple directions, after which they overran several checkpoints in the city.
Local military experts believed the Taliban offensive followed their loss of control over the southern province of Helmand.
"NDS forces in their headquarters are engaged in heavy clashes with the Taliban".
Clashes in Farah come amid the Taliban's annual spring offensive, as they vow to target the "American invaders".
Clashes between militants and security forces forced Farah residents to close shops and businesses.More news: Rhetoric over U.S. exit from Iran deal rises amid threat of sanctions
More news: Watch the first trailer for Queen biopic Bohemian Rhapsody
More news: Newcastle United Players Rated In Terrific 3-0 Win Over Chelsea
The Afghan Defense Ministry said in a statement that "serious measures" had been taken to defend Farah after the militants launched their offensive from the city's north side. "Gun battles, air strikes and explosions are taking place around the city", he told Xinhua earlier by phone.
Another provincial council member, Dadullah Qani, confirmed Hissaini's comments. Both the Taliban and Islamic State forces have staged shooting and suicide bombing attacks in Kabul and several other cities.
"I saw two rickshaw drivers on the ground with their arms blown off", said Khan Mohammad, a local resident who saw the initial blasts and the start of the gun battle.
Another resident told TOLOnews that people were running from the city and the situation is "very bad".
Many radio and television channels in the province have stopped broadcasting, fearing for their employees' lives, according to media watchdog Nai.
Clashes have been ongoing for the past few months in different parts of Farah province.
It's also an important economic area with the multi-billion-dollar TAPI (Turkmenistan, Afghanistan, Pakistan and India) gas pipeline planned for the region.
But it has been the scene of intense fighting in recent years. During 2017, they failed three times to seize the city.