President Trump at the commissioning ceremony for the Gerald R. Ford aircraft carrier in Norfolk, Va., on Saturday. CreditHilary Swift for The New York Times

“NORFOLK, Va. — With flag-hoisting, gun-firing, horn-blowing fanfare, the United States Navy opened a new era on Saturday as it commissioned the first of a generation of more powerful, technologically advanced aircraft carriers that will transform the fleet in decades to come.

President Trump presided over the commissioning ceremony for the nuclear-powered Gerald R. Ford, the first in a new class of aircraft carriers in 42 years. Although the carrier took longer to build and cost more than initially expected, it nonetheless represented a milestone for the Navy as it seeks to modernize in a world of ever-changing national security challenges.

“American steel and American hands have constructed a 100,000-ton message to the world: American might is second to none,” Mr. Trump said to a crowd on a sweltering below-deck hangar that will transport warplanes to the world’s danger zones. “And we’re getting bigger, better and stronger every day of my administration, that I can tell you.”

Named for the 38th president, the Ford is roughly the same size as the Nimitz-class carriers welcomed into the fleet in 1975 by Mr. Ford, but it packs more punch. The superstructure is smaller and farther back on the ship, which will allow it to launch 33 percent more flight missions a day using a new catapult and landing system. With nearly three times as much electricity, digital navigation and touch-screen technology, the ship will have a smaller crew and should save $4 billion over 50 years, according to the Navy.

But its path to this day was not always smooth. The ship cost $2 billion more than the initial $11 billion estimate and took two years longer than expected to finish because of problems with the new catapults. Even now, it will require an additional four years of trials before deployment, costing $780 million more, according to a Government Accountability Office report.

Mr. Trump complained about the costs to Time last spring and suggested returning to using steam catapults because the new system “costs hundreds of millions of dollars more money and it’s no good.” But he is also entranced with the carrier, having already visited it once before, and he made no mention of its troubles on Saturday as he celebrated the “wonderful, beautiful” warship.

“When it comes to battle, we don’t want a fair fight,” he said. “We want just the opposite. We demand victory, and we will have total victory, believe me.”

He touted his proposal to increase military spending and asked sailors to call members of Congress to support it.

Joining him for the ceremony were governors, lawmakers and Defense Secretary Jim Mattis. Also on hand were veterans of Mr. Ford’s administration, including Dick Cheney, who served as his chief of staff, and Donald H. Rumsfeld, who was his defense secretary.

Susan Ford Bales, the president’s daughter and the ship’s official sponsor, gave the command to “bring her to life.” To the strains of “Anchors Aweigh,” the flag was hoisted, sailors in white uniforms reported to stations and radar dishes began to spin.

Her father was a Navy lieutenant commander during World War II, and she said, “There is no one, absolutely no one, who would be prouder of the commissioning of this mighty ship than the president of the United States, Gerald R. Ford.””