At least 20 Taliban militants were killed and eight others wounded when government forces repelled a militant attack on Aybak city, capital of Afghanistan's northern province of Samangan, on Sunday night, the country's Interior Ministry confirmed on Monday.
The ministry said in a statement that Taliban fighters fled surrounding areas of the city after casualties were inflicted.
The militants stormed the city from several directions, trying to take control of the city Sunday night.
Earlier on the day, Taliban spokesman Zabihullah Mujahid wrote on social media that the insurgents seized control of several areas in Aybak.
On Sunday night, Taliban also attacked Pul-e-Khumri city, capital of neighboring Baghlan province, triggering heavy battles, according to local sources.
Many Afghan cities and about half of the country's 34 provinces have been the scene of heavy battles and street fighting in recent weeks as Taliban militants continued their fighting against security forces.
Taliban militants have taken control over three provincial capitals after heavy clashes in recent days.