Stephanie Greene, a longtime political supporter of D.C. Mayor Marion Barry and special assistant to his wife Effi for the last three years, resigned unexpectedly yesterday. Greene, according to associates, has privately cited as one reason for her resignation her embarrassment over the controversy surrounding the hiring of mayoral aide Sallie Melendez.

Also yesterday, the mayor's office confirmed that George Thomas, an accountant who was brought in a year ago to straighten out Barry's official expense records, has asked to be transferred back to the Water and Sewer Utilities Administration, where he previously worked.

Thomas said yesterday that his work in Barry's office was complete and that as chief financial officer of the water and sewer administration he would oversee a budget of more than $300 million, compared with about $5 million in the mayor's executive offices. Administration sources said that Thomas also wants to get out of the highly charged political atmosphere of the mayor's office.

Thomas' requested move and the resignation of Greene, who told Effi Barry of her decision on Monday, come during a period of what one District Building staff member said was "turmoil here" over staffing assignments. Several aides to Barry have said in recent days they were incensed over the unexpected hiring of Melendez.

Melendez, a former public relations official from Oakland, was hired by Barry on Oct. 1 at a salary of $63,185 a year, but she was not given specific duties until Friday, two days after news media inquiries about her responsibilities. Melendez on Saturday went on leave without pay until Dec. 1 to conduct a private group shopping trip to Hong Kong.

Greene, who has known Barry since college and worked in his first mayoral campaign in 1978, declined to comment on her resignation yesterday and referred questions to Barry. Barry said through a spokesman that he regrets Greene's decision to leave but understands that she wants to return to family life. He said he expects to use her as a volunteer in some capacity in the future.

Asked about Melendez, Greene said in a telephone interview, "I think people's imagination is overworked. I have been devoted to this mayor."

Greene, 45, said she had no immediate plans except to "go home" but was not sure when her resignation would take effect. She said she may consider working in government at some other time.

One friend said Greene, who joined Barry's administration after the 1982 campaign, had become distressed by a series of publicized events that made working for the mayor's office difficult, including publicity earlier this year involving Barry and Grace Shell, a part-time model who complained that Barry was harassing her.

Friends said they did not believe that Greene, who was paid $34,000 a year, and Effi Barry have had a falling out. One friend said the accumulation of problems associated with the Barry administration -- including federal probes and recent publicity about the purchase of a fur coat for Effi Barry with government funds that were later reimbursed -- was very stressful.

"She's embarrassed and everything else about things that have happened . . . . She didn't want to leave {and make it appear} like she was jumping off a sinking ship," the friend said. Two persons in separate interviews described Melendez as "the straw that broke the camel's back."

Greene is one of three city employes assigned to work with Effi Barry, who maintains an office in the mayor's suite on the fifth floor of the District Building. In addition to Greene, a $17,000-per-year clerk typist and a full-time police security officer are assigned to the mayor's wife.

The staff assigned to Effi Barry, who is not paid but holds Cabinet rank, is similar to that of Virginia First Lady Jeannie Baliles, who has a $26,140-a-year administrative assistant and an $18,000-a-year aide who is assigned to manage the historic governor's mansion.

In Atlanta, Mayor Andrew Young's wife Jean has no full-time aides.

A receptionist, who also answers the telephone for the mayor's office, is assigned to keep track of her official schedule.

Jean Young also heads the mayor's task force on education and the mayor's spokesman said she has access to staff members as needed.

The change in Barry's controller's office was expected for several weeks.

Thomas, a certified public accountant, became an influential player in the Barry administration during the summer of 1986 when Barry chose him to review financial accounting in the mayor's office, including travel and personal expenses as well as expenditures from the mayor's controversial ceremonial fund, which is being investigated by a federal grand jury.

Thomas' expected replacement is Clint Jones, a budget analyst for the District since 1981.