WEST PALM BEACH, Fla. — An Orthodox Jewish rabbi who was barred from serving as an Army chaplain because he refused to shave the beard required by his faith has won his legal fight against the military and will be sworn in Friday.

Rabbi Menachem Stern of Brooklyn will be officially admitted to the chaplaincy in a ceremony at The Shul Jewish Community Center in Surfside, Fla. Stern is a member of the Chabad Lubavitch movement of Judaism, whose rabbis are prohibited from shaving their beards.

"I felt this was my calling," Stern said of the chaplaincy.

The rabbi saw an advertisement in late 2008 for military chaplains and attended a recruiter's presentation. After consulting with his wife, he decided to apply in January 2009, making clear in his application he intended to keep his beard.

"Although we adapted to the modern world, we still maintain old-world values," he wrote. "By not trimming my beard, I represent the unadulterated view of the holy Torah, the way we believe a person should live."

Some Orthodox Jews don't shave, believing it's outlawed by a passage in the Book of Leviticus: "Do not clip your hair at the temples, nor trim the edges of your beard."

According to the lawsuit he filed later, Stern was alerted by both email and letter that he had been accepted. When he first got word, he said he jumped in the air, thrilled at the news.

A day after the latter mailing, though, the Army rescinded its offer, citing its prohibition on beards.

"To find out the following day that it was an error was a very big letdown," he said.

Stern has ministered in prisons, hospitals and nursing homes, taught at a Hebrew school, volunteered as an EMT and directed children's summer camps. But he said he felt the military chaplaincy most fit his duty to "make the world a better place with acts of goodness and kindness."

Military chaplains provide spiritual counsel to soldiers who seek it. Jewish chaplains are often sent to war zones to celebrate the High Holy Days.

New York's two senators, Chuck Schumer and Kirsten Gillibrand, and Sen. Joseph Lieberman of Connecticut wrote to the Army on Stern's behalf. The Aleph Institute, in Surfside, Fla., also took on Stern's case, filing a federal lawsuit in Washington a year ago. Aleph works on behalf of the Department of Defense in vetting rabbis to serve as military chaplains.

The two sides reached a settlement Nov. 22 allowing Stern to serve. Observers say it is just the second time ever — and first in more than 30 years — that a bearded Jewish rabbi has been granted an exemption to serve as a military chaplain.

Army regulations require men to be clean-shaven except for neatly trimmed mustaches as part of a long list of grooming standards that dictate everything from fingernail length to wigs.

The lawsuit notes aside from another rabbi in the 1970s, a handful of Sikh and Muslim chaplains have been granted exemptions from the beard ban in recent years. Additionally, it notes, members of the Special Forces are routinely granted exemptions, purportedly for missions in the Arab world, where a beard could allow a soldier to blend in.

The Army says, all told, five exemptions to its grooming policies have been granted since 2009. An Army spokesman, Paul Price, would not comment on the specific settlement in Menachem's case but said any such request is dealt with on a case-by-case basis.

"Each accommodation request was carefully reviewed and analyzed on an individual basis," he said.

Rabbi Sanford Dresin, a retired Army chaplain and director of Aleph's military programs, will administer the oath to Stern on Friday. While the settlement with the Army does not change the rule on facial hair, he hopes it will help ease the exemption process for future rabbis.

"If the Army can live with the repeal of 'don't ask, don't tell,' I think it can live with a few bearded rabbis," said Dresin, who does not wear a beard.

Dresin called Stern "the ideal candidate" for the chaplaincy and said he admired his tenacity and excitement about the job.

"He's like a kid in a candy store he's so excited," he said.

Stern, 29, will go through chaplain training at Fort Jackson, S.C. He is taking a leave of absence from his management job in the financial industry for his Army Reserves post but hopes to be called to active duty soon. He said he's relieved he can finally move forward in a job he sees as bringing goodness to the world by ministering to soldiers, though he wishes it wasn't such a fight.

"I was expecting that I would be accepted the way I am, not that I would have to fight and make headlines," he said.