BERLIN — Fresh from another strained international gathering with President Trump intended to remember the devastation of World War I, Chancellor Angela Merkel of Germany said Tuesday that Europe’s future should include “a real European army.”

Ms. Merkel, who announced last week that she would not seek another term, spoke more forcefully than ever about the European Union’s need to pull together — and to depend more reliably on itself, without dependence on the United States, when defending its interests. She did so in a speech about Europe’s future before the European Parliament in Strasbourg, France, which was seen as an effort to leave a legacy as her own power slowly fades.

Her comments came hours after President Trump launched a blistering personal attack on President Emmanuel Macron of France, who also has proposed a European army.

“The days where we can unconditionally rely on others are gone,” Ms. Merkel said in a speech televised around the Continent. “That means that we Europeans should take our fate more into our own hands if we want to survive as a European community.”