WASHINGTON — Just hours after President Trump was sworn into office, the Senate on Friday confirmed two nominees for critical national security positions, approving James N. Mattis as defense secretary and John F. Kelly as homeland security secretary.

Republicans had hoped to approve far more than two nominees on Mr. Trump’s first day in office, but that process has been delayed in part because several of the nominees have been slow in filing ethics disclosures, prompting protests by Senate Democrats.

While Republicans sought to confirm a third national security nominee on Friday, Representative Mike Pompeo of Kansas, the president’s choice to lead the Central Intelligence Agency, Democrats managed to delay his approval until Monday, when he is expected to receive a vote after some debate.

Three Democratic senators — Ron Wyden of Oregon, Patrick J. Leahy of Vermont and Richard Blumenthal of Connecticut — objected to what they characterized as an overly speedy push to confirm Mr. Pompeo.

“We ought to have a debate in broad daylight, not when senators are trying to figure out if their tux is going to fit,” Mr. Wyden said.

The skirmish over nominees set a grim tone for the first day of the Senate under the new president. The majority leader, Mitch McConnell, Republican of Kentucky, chastised Democrats for delaying nominees, pointing out that the Senate had cleared seven cabinet-level officials on President Obama’s first day in office in 2009.

Senator Dick Durbin, Democrat of Illinois, responded that Mr. McConnell had refused to even allow a hearing to be held for Mr. Obama’s Supreme Court nominee, Judge Merrick B. Garland, during his last year in office.

“For those who have forgotten the record of the Republicans in the Senate when it comes to delaying nominations, Exhibit A will continue to be the vacancy on the U.S. Supreme Court,” Mr. Durbin said on the Senate floor, adding, “That vacancy continued for political reasons regardless of the fact that it created at least a hardship and some confusion on the highest court of the land. It went on for 10, 11 months and it continues to this day.”

Image

John F. Kelly was sworn in as homeland security secretary by Vice President Pence. Karen Hernest, his wife, held the Bible.CreditDoug Mills/The New York Times

Both Mr. Mattis and Mr. Kelly are retired Marine Corps generals. Federal law requires a seven-year waiting period between active duty and serving as the secretary of defense; Congress passed legislation last week granting a waiver to Mr. Mattis, and Mr. Trump signed it on Friday.

The Senate voted 98 to 1 to confirm Mr. Mattis. Senator Kirsten E. Gillibrand, Democrat of New York, voted no “because she believes civilian control of the military is fundamental,” said a spokesman for the senator, Marc Brumer.

The vote to confirm Mr. Kelly was 88 to 11.

At a luncheon at the Capitol, Mr. Trump said the generals in his cabinet “are going to keep us so safe” while describing them as out of “central casting.” He also nudged the Senate Democratic leader, Chuck Schumer of New York, over the pending confirmations.

Because of an editing error, an earlier version of this story misstated the middle initial of the judge whose nomination to the Supreme Court was stalled in the Senate. He is Merrick B. Garland, not Merrick M.