A controversial Saudi Arabian sheik, trailed by an entourage of about two dozen persons, swept into the District Building yesterday for a surprise visit with Mayor Marion Barry and presented him with a $50,000 check to benefit the city's summer jobs program for youth.

Barry, in turn, proclaimed the day "His Excellency Doctor Sheik Mohammed S.A. al-Fassi Day" during a brief ceremony in the mayor's office. He said the money would be given to the Private Industry Council, a local organization that helps find jobs for youths.

The quiet-spoken, slightly built Fassi first gained notoriety in the United States a few years ago when he purchased a Beverly Hills mansion and enraged neighbors by painting nude statues on the property in garish colors and filling ornamental urns with artificial flowers.

Accompanied by his third wife and the entourage that accompanies him around the world, Fassi flew into Washington Tuesday in a leased Boeing 707 to attend a White House function and a Republican Party fund-raiser, a spokesman for the sheik said.

Barry said he didn't know about the sheik's plans until late yesterday.

According to Fassi's aides and Barry, Washington businessman Arthur McZier, a friend of two of the sheik's lawyers, first mentioned the city's need for money during a social gathering this week. McZier is a member of Barry's campaign finance committee.

One of the spokesmen for Fassi said that the talk first concerned giving money to keep the city's swimming pools open for a longer period this summer, but that city officials were more interested in the jobs program.

McZier, who, with his wife, Ruby, holds development contracts for the city's new convention center, said he has no business ties to the sheik.

During yesterday's ceremony, Barry and Fassi, who is a brother-in-law of a prince of the royal Saudi family, spoke to each other through an interpreter, exchanging pleasantries and comments about friendship and world peace.

"We appreciate his fine offer not only to visit but to help our city," Barry said.

Replied Fassi: "We are convinced that the friendship between the American people and Saudi Arabia is a long-lasting friendship. It is our duty to come here."

Fassi then said in English, "It is a pleasure to visit. Washington is a beautiful city. I am honored to meet with you, Mr. Mayor. I feel most welcome to express my appreciation."

The ceremony was quickly concluded after reporters, who had been alerted to the impending visit by the mayor's press secretary, began asking questions about the genesis of the gift and the sheik's plans.

Aides to the sheik said they did not know how long he would remain in Washington or whether there would be any further gifts.

"This is a most friendly event that he ever had in Washington, D.C.," one of the aides said.

Fassi, who currently lives in the posh Diplomat Hotel in Hollywood, Fla., is being sued for divorce in Los Angeles by his first wife, Dena, who is seeking a $3 billion settlement, about half his reported worth.