A Salvadoran who was to have been deported from the United States on the day his American wife expects to deliver their baby has won permission to remain in this country for eight months while the government reconsiders its ruling that their marriage is a sham.

Marco Mejia, a waiter and student at the University of the District of Columbia, is mounting what is believed to be the first challenge of a law that took effect last Nov. 10 declaring fraudulent any marriage after that date between an alien facing deportation proceedings and a U.S. citizen.

Mejia and his wife Rebecca, a lecturer at Georgetown University, got married in January after living together for almost a year. Because Mejia entered the United States without a visa in 1983, he faced deportation, and immigration authorities told him he would have to leave for two years or seek political asylum.

The 1986 law was designed to prevent aliens from avoiding deportation by entering sham marriages, which immigration officials called a popular tactic. The Mejias have argued that they have a legitimate, loving marriage and that the law is unfair.

A deportation date of Dec. 20 had been set for Mejia, but an immigration judge ruled last week that he may stay with his wife while the Immigration and Naturalization Service considers a petition asserting that their marriage is valid.

"It's a stupid law," Rebecca Mejia said. "I love my husband. If I had wanted to marry for money, I would have married a Saudi Arabian oil sheik, not a Salvadoran waiter."

Rebecca Mejia said she will follow her husband if he must leave this country.