Britain's impending departure made it easier to get the project off the ground as London has traditionally been skeptical about EU military cooperation, seeing North Atlantic Treaty Organisation as the main vehicle for common European defense efforts.
Similar efforts to deepen military links have been frustrated for decades, partly by Britain's fierce opposition to anything that might lead to a European army.
Participants have signed up to a list of commitments which "include increasing the share of expenditure allocated to defense research and technology with a view to nearing the 2 percent of total defense spending" and to "regularly increasing defense budgets in real terms".
Mogherini said after hosting talks for European Union foreign ministers: "We expect no external interference" in Lebanon's affairs.
Mrs Mogherini said the move would not only complement Nato's security aims but fill in gaps in the Atlantic alliance.
"Today we will launch a new page for the European Defence", said Frederica Mogherini, the EU's foreign and defence policy representative.
"The real issue is not how much we spend but the fact we spend in a fragmented manner", she said.
Their signatures are a sign of political will but the program will only enter force once it's been legally endorsed, probably in December.
It pledges that countries will provide "substantial support" in such areas as personnel, equipment, training, and infrastructure for European Union military missions.
France was initially keen for a smaller group of nations that would more readily commit to possible foreign interventions such as in Libya or Mali.
Germany wanted as many countries as possible to sign up but for it to undertake more modest schemes, and Berlin's vision looks to have won the day.
"This is the beginning of a common work - 23 member states engaging both on capabilities and on operational steps, that's something big", Mogherini said.
Participation is voluntary for the EU's 28 member states.
"The Germans say respect unity and proceed modestly at the start with all these little projects - they won't help the EU's independent capacity", Mr Mauro said.
Britain, Denmark, Ireland, Portugal and Malta did not join the pact, but the initiative remains open to any country that decides to sign up later, officials said. "It has no chance of working". Britain can take part in some if they are of benefit to the entire EU.