The Knavses have a relatively high profile for presidential in-laws. They frequently travel with the Trumps and split their time between New York, Palm Beach and Washington, where they stay in the White House.

Since initial reports emerged in February that the Knavses had obtained permanent residency in the United States, there has been a lack of clarity about when or how the couple received green cards. And unless the couple themselves divulge the timeline of their citizenship process, the applications and petitions are protected by privacy law.

Under immigration statutes, the Knavses would have needed to have their green cards for at least five years in order to apply for citizenship, along with fulfilling character, residency and civic knowledge requirements. The time to process an application for naturalization in New York City typically ranges from 11 to 21 months, according to the U.S. Citizenship and Immigration Services.

Their lawyer said that the couple had met the five-year requirement, but added, “I can’t give further comment.”

News of the ceremony prompted an immediate response on Twitter.

Ana Navarro, a Republican strategist and political commentator, tweeted, “I guess when it’s Melania’s Family, it’s ‘family reunification’ and should be applauded. Everybody else, it’s ‘chain migration’ and must be stopped.”

But Mark Krikorian, the executive director of the Center for Immigration Studies, a think tank that supports tighter controls on immigration, said in an interview that the Knavses were following the law. “It’s the current system,” he said. “The question is what is the policy, and if a different policy is better, I’m all for it, but it doesn’t mean people working within the current policy are doing anything morally wrong.”

The president often rails against family-based immigration at his rallies, and has called it a pathway for terrorists to enter the country. He frequently reminds his audiences of the October terror attack in New York, where Sayfullo Saipov, an immigrant from Uzbekistan, plowed a pickup truck down a bike lane, killing eight people near the World Trade Center. While the president never names Mr. Saipov, who obtained his green card through the equally maligned diversity lottery, which grants visas to people from countries that have had fewer immigrants, he has been known to detail the attack.