Kabul - A truck bomb ripped through the outer perimeter of a foreign security compound in Afghanistan's capital early on Tuesday, killing two Afghan security guards and wounding a foreigner, police and security sources said.

The jihadist Afghan Taliban, ousted from power by a U.S.-led coalition in 2001, claimed responsibility for the attack on the compound on the eastern outskirts of Kabul.

Two insurgent fighters armed with guns tried to enter the compound after the explosion, but were shot dead by guards on the inside, officials said.

"They blew the main wall and the guys nailed them as they tried to enter. The outer wall was breached," a Western security official said.

Attacks on foreign troops, Afghan government officials and security forces have intensified as the international military coalition draws down operations, leaving the fight against the Taliban insurgency mostly to Afghan forces.

Taliban spokesman Zabihullah Mujahid said in a statement the blast "brought down all security barriers and walls. Several other attackers went inside and took the foreigners under heavy fire."

The base, known as the Hart Security Compound, is used by foreign security contractors who work with various diplomatic missions, including the European Police Mission in Afghanistan (EUPOL).

Security sources said the attack was planned by the Haqqani Network, which is allied with the Taliban and often credited with the more complex assaults in the capital.

Such a large truck bomb is unusual even in the violence-weary Afghan capital, which security officials say has seen a 50 percent rise in attacks in 2014 compared to last year.