Image copyright AP Image caption Thirty-one people were killed in Tuesday's bomb attacks on Brussels

A former CIA director has said the European Union "in some ways gets in the way" of security services, as the debate continues over whether the UK would be safer in or out of the EU.

Retired general Michael Hayden told the BBC the union was "not a natural contributor to national security".

Home Secretary Theresa May has said there are "good reasons" on the security front to stay in the EU.

An in-out referendum on UK membership of the EU takes place on 23 June.

Security has been a key argument in the debate so far, with In campaigners saying being in the EU makes the UK safer, and Out campaigners arguing the opposite.

Is Britain safer in or out of the EU?

It has intensified following Tuesday's terror attacks on Brussels, which claimed 31 lives.

Former MI6 head Sir Richard Dearlove said EU-based security bodies were of "little consequence" and that leaving the EU could boost Britain's security.

But the former head of GCHQ, Sir David Omand, has said the UK enjoys the best of both worlds by staying in - remaining part of an established information-sharing network while still retaining control of the border.

Prime Minister David Cameron has warned that leaving Europe would be a "threat to national security" and, after Brussels was bombed, Mrs May called for the UK and its allies to work with "greater urgency and joint resolve" to defeat terrorism.

Image copyright Getty Images Image caption Michael Hayden says European security services are often keener to work with the CIA than their European counterparts

Speaking on BBC Radio 4's Today programme, Mr Hayden said the standard of security services across Europe was "very uneven".

France and Britain had "very good" services, he said, while in Scandinavia, they were "good but smaller".

The rest of Europe had "small" services and Belgium's, in particular, was "small, under-resourced and legally limited - and frankly working for a government that has its own challenges in overall governance".

'American panic'

He said he agreed with Sir Richard that leaving the EU could boost Britain's security.

Mr Hayden said: "I don't mean to be arguing against the European Union, but the union is not a natural contributor to national security to each of the entity states.

"In fact in some ways [it] gets in the way of the state providing security for its own citizens."

He rejected a suggestion that the UK leaving the EU would affect the US's ability to co-operate with national security services, adding that European security services were "more forthcoming with us than they are with one another".

"We are a huge security service and each sees their national interests as being well served by having a productive relationship with us and, frankly, the same math does not apply to other services on the continent," he said.

Asked about US President Obama watching baseball in Cuba as the Brussels attacks unfolded, he said he thought the president wanted to deny the enemy the "image of victory of American panic" over their attack. Later, a US official said at least two of the dead were US citizens.

'Mistrust'

Philippe De Backer, a member of the European Parliament with a particular interest in intelligence services, said he strongly disagreed with Mr Hayden's comments over the EU.

"If he were faced in the US with separate services... he would be the first to call for a centralised agency," Mr De Backer, of the Belgian Group of the Alliance of Liberals and Democrats for Europe, told the Today programme.

There is currently no EU-wide intelligence-sharing arrangement.

However, the European Parliament had long called for closer co-operation on intelligence, but "mistrust" between member states had stifled that, Mr De Backer said.

He suggested that if the UK left the EU, it would be hard for it to keep up with Europe-wide policing and security services.

"I think we are now at a turning point. Because of this fragmentation in 28 different intelligent services, we have seen the information services have not always been up to speed," he said.

'Nationalist rise'

He said it was time to give greater strength and more resources to Europol and Eurojust, because a "helicopter view" was the only way to dismantle the terrorist networks.

He said member states must now move on from the "old concept of sovereignty" towards a "shared sovereignty where we understand that we are better off when we share information and pool resources".

Dominique Moisi, who helped to found the French Institute of International Relations, said there was a "dramatic lack of collaboration and exchange of information" across European intelligence agencies.

This was partly due to a "pecking order" in which France and Britain rated each other but no-one else, "sometimes rightly, sometimes wrongly", he told the BBC's World At One.

Europe had to rediscover the "dimension of security to regain some of its hard power", he added, but there was a kind of "protective, emotional, nationalist rise which is a stumbling block to rationality."