MADRID (Reuters) - A Spanish High Court judge agreed on Wednesday to investigate allegations that Spain's ambassador to Afghanistan ignored security concerns before the Taliban attacked the country's embassy in Kabul last year, killing two Spanish policemen.

The widow of one of the dead policemen and seven Spanish police officers injured in the attack had accused the ambassador in Kabul, Emilio Perez de Agreda, and his former deputy, Oriol Sola Pardel, of involuntary manslaughter over the alleged security failings.

High Court Judge Santiago Pedraz said in a court ruling on Wednesday that he had decided to investigate the allegations.

Spain's Foreign Ministry said on Wednesday it and the two accused diplomats were ready to cooperate with the court to clarify the facts.

In December 2015, Taliban fighters attacked a guest house attached to the Spanish embassy in Kabul, killing the two Spanish security officers and four Afghan police as well as injuring the seven Spanish police officers.

The widow and the injured officers say the Spanish Foreign Ministry and Perez de Agreda had known about the embassy's security failings soon after it was built in 2008 but the ambassador never acted on recommendations to remedy them

Their complaint alleges that the French secret service warned on the morning of the bombing of the risk of an attack against the embassy and that this should have led to extraordinary security measures being taken.

(Reporting by Rodrigo de Miguel and Adrian Croft; Editing by Angus Berwick and Alison Williams)