The imam, a 38-year-old Egyptian, seemed not to notice the stares from other shoppers. He was hunting for a bargain, and soon found it in the beverage aisle, where a 32-can pack of Coca-Cola sold for $8.29. For Mr. Shata, this was a satisfying Islamic experience.

“The Prophet said, ‘Whoever is frugal will never suffer financially,’ ” said the imam, who shops weekly at the local store and admits to praying for its owners. He smiled. “These are the people who will go to heaven.”

Seven months have passed since Mr. Shata moved to this New Jersey suburb to lead a mosque of prosperous, settled immigrants. It is a world away from Bay Ridge, Brooklyn, where he toiled for almost four years, serving hundreds of struggling Muslims for whom America was still new.

For Mr. Shata, Middletown promised comfort after years of hardship. He left behind a tiny apartment for a house with green shutters set amid maple trees and sweeping lawns. He got a raise. He learned to drive.

But the suburbs have brought challenges that Mr. Shata never imagined. His congregation in Brooklyn may have been on the margins of American society, but it was deeply rooted in Islam. Muslims in Middletown were generally more assimilated but less connected to their mosque.

To be a successful suburban imam, he found, meant persuading doctors and lawyers not to rush from prayers to beat traffic. It meant connecting with teenagers who drove new cars, and who peppered their Arabic with “like” and “yeah.” It meant helping his daughter cope with mockery at school, in a predominantly white town that lost dozens of people on Sept. 11.

Mr. Shata knew from his years in Brooklyn that the job demanded more than preaching and leading prayers, the things for which he was trained in Egypt. In America, he helped to arrange marriages. He mediated between the F.B.I. and his people. He set up a makeshift Islamic court to resolve disputes among hot dog vendors.

Last summer, as he prepared to join a new community where the median income is roughly $86,000, he reminded himself that Islam has no quarrel with wealth — as long as the wealthy are pious. Still, he was stunned when a man at the mosque bought his daughter a new car, only for her to request a different model.

“Islam says to a Muslim you can own the world if you want, but don’t get attached to it,” said Mr. Shata, speaking Arabic through a translator. “Put the world in your hands, not your heart.”

The open spaces of Monmouth County appealed to the imam after years in a crowded city. But with space comes distance. It hardly surprised Mr. Shata that prayer attendance was thin; many congregants live more than 20 miles away.

In a land of Little League and shopping malls, signs of Muslim identity are few. At first glance, Mr. Shata’s new mosque could pass for an elegant office building. It has no minaret and a barely visible dome.

Girls in head scarves are scarce at the local public schools. Some cover their heads with hooded sweatshirts.

Compared with his congregants, the imam sometimes looks like an apparition from another century. In his silk hat and robe, he preaches to men in suits or blue jeans, cellphones clasped to their belts.

But Mr. Shata believes this group is vital to Islam’s future in the West. The religion’s survival, he said, depends not only on its ability to flourish in the immigrant footholds of America, but in its most settled corners.

“We are in this country, and we must learn to live with its people,” Mr. Shata said. “We have to absorb them and they have to absorb us.”

Leaving Brooklyn

One sunny afternoon in September, the mosque’s parking lot was empty but for a red 1997 Dodge Neon. It circled around and around, with Mr. Shata at the wheel. He was practicing for his driving test.

“Now we’re at the stop sign, and we must stop out of respect,” he said, slamming on the brakes. The car halted violently. Then he stomped his sandaled foot on the gas, and the car lurched ahead.

Mr. Shata had never driven a car until he moved to Middletown. As a boy, he became frightened of driving after a tractor killed a man in his Egyptian farming village. Since moving to the United States in 2002, he had managed without a car. But in the suburbs he had no choice.

Middletown is only 43 miles southwest of the city, but to Mr. Shata, it seemed farther.

In Brooklyn, his daily walk to the mosque, Masjid Moussab, caused a commotion, with cabdrivers honking and shopkeepers waving. In Middletown, where Mr. Shata now lives next to the mosque, he sees deer and rabbits on his way to the dawn prayer.

But Brooklyn had a way of following him. Fathers in Bay Ridge still sought the imam’s help in finding suitable husbands for their daughters. Unhappy wives called for the imam’s marital advice.

Every Friday, a dozen of Mr. Shata’s former Brooklyn congregants began appearing in Middletown to hear his weekly sermon.

“Maybe he’s here in body, but his soul is there,” said Amgad Abdou, an Egyptian driver who came every week, his limousine full. “He’s like the Statue of Liberty, part of the skyline. He’s part of Bay Ridge.”

Mr. Shata missed the city at times. But his relationship with Muslims in Brooklyn had changed after a series of articles about him appeared in The New York Times last March.

At first, he found himself a minor celebrity. The articles were reprinted in Arabic-language newspapers, both in the United States and the Middle East. Hundreds of strangers reached out to him, seeking advice.

The imam’s “little black book” — a roster of Muslims in search of spouses — quickly lengthened, by a third, to 820 phone numbers and names.

But the articles also stirred a controversy Mr. Shata never expected. Many Muslims were shocked to read that the imam thought oral sex was permissible for married couples (even though respected Islamic scholars in the Middle East concurred with his opinion, he said). Others objected to his view that Muslims could sell liquor or pork if they could find no other work.

Photo

Mr. Shata and his family enjoy Middletowns tranquillity, a sharp contrast to their old Brooklyn neighborhood. Outside their new home, which is next to the mosque, he lingered with his young son, Mohammed, and his daughters Esteshhad, left, and Rahma.Credit
James Estrin/The New York Times

One critique of Mr. Shata on a jihadist Web site in England singled out his hometown, Kafr al Battikh, which is known for its watermelons. “Oh, Allah,” it read, “preserve Islam and Muslims from the evil people of watermelons.”

In Bay Ridge, the articles prompted a fistfight outside a Dunkin’ Donuts. Fliers warned in Arabic that the imam was “a devil.”

“He just wanted to please the West,” said Hesham Elashry, a local Egyptian tailor. “No one can change Islam to make people happy.”

After weeks of defending himself, Mr. Shata felt worn down.

Other mosques had long tried to lure him away. As word of his troubles spread, recruiters stepped forward.

“He was tied to his people,” said Mohammed Mosaad, who sits on the board of the mosque in Middletown.

Like many suburban mosques, Masjid Al-Aman, which means “mosque of peace,” began in the 1980s with a group of families who met privately to pray. Eventually, they bought a six-acre property on Red Hill Road and raised $1.7 million to build their mosque, which was completed in 2003.

Leaders of the mosque, which has a largely Egyptian congregation, called the imam for months. They offered to renovate a house on the property, with a new kitchen and a custom-made library.

Mr. Shata prayed for a sign from God. One morning at dawn, the imam said, he heard a voice telling him that the mosque in Middletown “is peace.”

One evening in July, shortly before Mr. Shata moved to the suburbs, he paid the mosque in Middletown a visit.

Crickets chirped. The grass whispered. The stars blinked from above.

The imam circled the mosque, accompanied by three friends. He paused to look at the trees, which seemed to sparkle.

Mr. Shata turned to the men and asked if the forest might have jinn, the Arabic word for spirits.

“No,” one of the men replied. “The bugs light up here.”

It was one of many things that impressed Mr. Shata about his new environment. He loved to sit on his front porch and write his Friday sermons. The rain, he said, was “like a symphony of music.”

In Brooklyn, the imam’s family rarely left their apartment. His 8-year-old daughter, Rawda, is epileptic and used to suffer frequent seizures. Now the four children run freely on the grass. Rawda has not had a seizure for months, ever since doctors changed her medication.

The imam’s wife, Omyma, looked up at the sky one September afternoon.

“Smell! Smell!” she said, inhaling deeply. “Pure oxygen. Pure.”

But if Mr. Shata’s family life had improved, his new mosque needed work.

In Bay Ridge, congregants lingered after prayers, exchanging kisses and hugs. In Middletown, an air of anonymity hung over the mosque.

“We needed someone to bring us together,” said one member, Omar Mostafa, 42.

Mr. Shata began by memorizing the names of his roughly 600 congregants and tracking their attendance. (The same prodigious memory had enabled him to memorize the Koran by the age of 8.)

An error has occurred. Please try again later.

You are already subscribed to this email.

A Jordanian-born cardiologist, Raed Jitan, missed the Friday prayer soon after he was introduced to the new imam. When the doctor reappeared at the mosque, he was stunned to hear Mr. Shata call out, “Raed, where have you been?”

It became common to hear the imam interrupt himself, midsermon, with admonitions like, “Ahmed, don’t fall asleep on me.”

One Friday, Mr. Shata ordered the congregants to stand up and exchange compliments. Another day, he told them they could not leave before shaking hands.

By the early fall, Masjid Al-Aman was a different place. Attendance at daily prayers had quadrupled. The imam’s evening lectures were packed.

“The seeds have taken root very fast,” Mr. Shata said.

He was relieved that many of his new congregants seemed modern-minded. But he is still adjusting to the fact that, at dinner parties, men and women often eat together. (Such engagements do not violate Islamic law, Mr. Shata said, but he and his wife prefer more traditional gatherings where men and women sit in separate rooms and have their own entrances.)

Mr. Shata uses Islamic contracts in Middletown, as he had in Brooklyn, to help settle disputes between married couples. But the money involved sometimes makes him gasp. In Brooklyn, a man had agreed to pay his wife $10 every time he insulted her. In Middletown, a similar contract brought $1,000 per insult.

Wealth became a frequent theme in his sermons.

“The true value of a person is not in his clothing, car or bank account, but in his account with Allah,” he said in one sermon.

At times, Mr. Shata could not help but think of his own financial status. He told himself that it did not matter that his house was modest compared with the “palaces” of some congregants, or that his used Dodge stood out among their Lexuses and BMWs.

“I am very satisfied with what God has given me,” he said one afternoon.

He did not know then that his 12-year-old daughter, Esteshhad, wanted to ask him for a cellphone.

On Sunday mornings, the main worship area of the mosque — a place normally reserved for men — becomes a teenage oasis.

Girls in head scarves sit to one side, and boys in sweatshirts and varsity jackets to the other. Their cellphones beep with text messages as the imam stands before them.

“Who has a question today?” he asked one recent Sunday.

A curly-haired boy raised his hand. “According to the Prophet, at what age should a young man get married?” he asked.

Mr. Shata launched into a careful lecture about how modern life is different from the Prophet’s time, when boys married at 16. Islam, he said, dictates no specific age.

Photo

Little is more important to Mr. Shata than cultivating the faith of Muslim youth and helping them bridge traditional and modern ways. Mr. Shata with a teenager, Omar Mosad, during a youth class.Credit
James Estrin/The New York Times

“Can a man marry more than one wife?” another boy asked.

“Why are the questions about marriage today?” the imam replied. “What’s going on?”

The room was silent. He wiped his glasses, trying to buy time.

“If you are able to marry one,” he finally said, “don’t think about marrying another one.”

Another hand shot up, that of a 16-year-old girl. “What are the specific circumstances that allow a man to marry a second wife?” the girl, Sara Abdelmottlib, asked.

Once again, the imam was cornered. Back in Egypt, young Muslims were reticent in the presence of sheiks. But in America, Mr. Shata noticed, children are taught to ask many questions.

Mr. Shata had no doubt about the answer: According to Islamic law, a man is allowed up to four wives. But the imam also believed that such arrangements never worked, and that discussing them was unhelpful in the United States.

He stared at the girls.

“There is no woman out there who agrees to her husband marrying a second wife, even if she cannot bear children,” he said.

Then he turned to the boys. “A man who is not satisfied with one wife will never be satisfied with four,” he said.

Miss Abdelmottlib looked over at the boys, her chin raised in triumph.

Mr. Shata often feels out of place among his youngest congregants. They seem so different from him — the way they dress, the way they speak, even the way they think. But he considers no part of his job more important.

“The tree of faith in their hearts has to be constantly watered before it dries up,” he said.

It seemed to Mr. Shata that young Muslims in the suburbs had no guide to help them balance Islamic virtues with adolescent urges, the culture of their parents with the pressures of their peers.

Some men at the mosque complained that their sons refused to kiss their hands in a show of respect. Mr. Shata sided with the boys: This tradition was cultural, he said, not Islamic.

Other parents forbade their daughters from joining swim teams at school, arguing that Islamic law does not allow women to reveal their bodies in public. The imam suggested a compromise: they could swim in bodysuits, with only females present.

Still, it was one thing for Mr. Shata to mediate these problems at the mosque, and another to face them at home.

One afternoon this month, a yellow school bus with mechanical problems pulled into the mosque’s parking lot.

The imam had just finished the afternoon prayer and was leaving the mosque. Eagerly, he walked up to the bus, his long robe flapping. He wondered if his daughter Esteshhad might be onboard.

As he drew closer, he saw the children pointing at him and laughing. He struggled, in English, to offer the driver help, but she politely declined. He searched for his daughter. It was not her bus. Relieved, he walked away.

For Esteshhad, life had been hard enough, he thought. After attending an Islamic school in Brooklyn, she is now one of only two girls who wear head scarves at her public middle school. She sits alone at the front of her bus. In the cafeteria, she eats by herself.

“They keep thinking I’m weird,” she said. “I feel weird, too.”

She hears about sleepovers and trips to the mall, but she has yet to experience these things. Her mother cannot drive, and Mr. Shata is reluctant to chauffeur his children until he feels safer in the car.

Outside school, Esteshhad’s only other contact with her peers comes at the mosque. But even there — where some girls carry designer bags — she often feels left out.

One night this month, she sat slouched on the edge of her bed. If only she had a cellphone or an iPod, she said, she might have friends.