By Giulio Piovaccari

MARANELLO, Italy (Reuters) - Italy will seek budget flexibility from the European Union if necessary to help it fund a multi-year plan to boost the country's defenses against earthquakes, Prime Minister Matteo Renzi said on Wednesday.

Speaking during a summit with German Chancellor Angela Merkel, Renzi said Rome would use all available resources to make the disaster-response program a success, promising it would be a carefully designed project, not a rushed job.

"We will follow all the rules laid out by Europe and, if we need more resources, we will discuss this in the appropriate places and take everything that is needed," he told reporters.

At least 293 people died when an earthquake struck central Italy on Aug. 24, leveling towns, villages and hamlets in the mountainous heart of the country.

The disaster dominated initial discussions between Renzi, Merkel and respective government ministers at their annual gathering, which this year was held at the headquarters of Italian sportscar maker Ferrari.

Merkel said she was sure Italy would present transparent, sound plans for Europe to consider, adding that Germany would help finance the rebuilding of a school in the quake zone.

"We will find a solution in Europe. We have had floods in Germany ... I am sure reasonable and sensible solutions will be found here," said Merkel, who shook the paw of one of the earthquake rescue dogs after arriving in Maranello.

Italy has one of the world's largest public debts and with a virtually stagnant economy it might struggle to find the money needed for costly civil defense programs.

It will also run into trouble with Brussels if it breaks EU budget rules. Renzi said funding needs in the immediate aftermath of the disaster would not be included in end-of-year deficit parameters, giving his government room for maneuver.

He has not yet said how much his disaster-prevention plan, which will include anti-flood measures, might cost.

"We will use European (budget) rules, but only when we have drawn up a serious, forward-looking project tied to good sense," Renzi said. "It is fundamental that we spend our money well."

Italy has launched programs in the past aimed at boosting anti-seismic measures across a country that is regularly rocked by earthquakes. However, many projects have been called into question, hit by corruption scandals and shoddy work standards.

Magistrates have opened investigations into why so many buildings were wrecked last week, including a school and a hospital, despite receiving state aid to help with the cost of adding earthquake protection.

Renzi appointed Vasco Errani to oversee the reconstruction effort. Errani is a former president of the northern Emilio Romagna region, which was hit by deadly quakes in 2012.

(Additional reporting by Andrea Shalal in Berlin; writing by Crispian Balmer; editing by Mark Heinrich)