(Adds attack's end, final toll)
By Hamid Shalizi
KABUL, Jan 21 (Reuters) - Suicide bombers and gunmen launched an eight-hour assault on the headquarters of the Kabul traffic police on Monday, Afghan officials said, in the second coordinated attack on a government building in less than a week.
The Taliban claimed responsibility for the operation In which all five attackers and three traffic police officers were killed, interior ministry officials said.
The attack raised the possibility that insurgents were shifting tactics, testing Afghan security forces in Kabul after a series of high-profile attacks on Western targets last year.
Violence across the country has been increasing over the last 12 months, sparking concern about how the 350,000-strong Afghan security forces will be able to manage once foreign troops withdraw by the end of 2014.
Last week, six suicide bombers attacked the National Directorate of Security (NDS), killing two guards. That attack followed December's failed assassination attempt on NDS chief Asadullah Khalid.
"It's very clear that more and more the Afghan security sources are getting into the lead, the more they are targeted by the insurgents," said Brigadier General Gunter Katz, spokesman for the NATO-led International Security Assistance Force (ISAF).
Monday's attack began when three men detonated suicide bombs outside the main entrance and was followed by the two remaining attackers storming the unfortified area, Deputy Interior Minister General Abdul Rahman said.
The pair, armed with automatic rifles, battled security forces outside the building nestled between two police hubs and close to parliament and a road commonly used by Afghan MPs.
Thick smoke rose from the compound and an Afghan Army helicopter hovered above as Afghan forces returned fire with rockets and machine guns.
The two gunmen were eventually killed by security forces, an interior ministry spokesman said.
"Honestly speaking, this type of attack, at the start of the year, indicates the coming months are going to be tough," a government official said, speaking on condition of anonymity.
"The Taliban will want to display their presence and reach with these kinds of attacks in Kabul." (Writing by Amie Ferris-Rotman and Dylan Welch; Editing by Nick Macfie)