Guards from the D.C. Jail and the Lorton Reformatory voted to end their two-day wildcat strike and return to work last night after they reached agreement to negotiate their grievances with city officials next week.

After a three-hour meeting of city negotiators, union officials and strike representatives, followed by a one hour session with Mayor Marion Barry, about 300 strikers outside the D.C. Jail and at Lorton agreed to end the city's first guard strike and return to work at midnight.

"All we demanded was a meeting with the mayor," said strike organizer Bernard Demczuk. "He met us halfway; we should meet him halfway. Its a good agreement, but we've only made a step."

In a memorandum of agreement signed by strikers and city officials, the guards agreed to return to work to exchange for assurances that they would be allowed to renegotiate their contract with the city, with special emphasis on safety and staffing levels.

The city also said it would not pursue unfair labor practice and contempt of court charges it sought yesterday morning after the guards continued to strike despite a restraining order issued Wednesday forbidding their job action.

The strikers' major concern, voiced throughout the two-day action, was that the number of guards now assigned to the D.C. Jail -- 397 -- was about 90 below a safe staffing level.

Another important issue, the push for the rehiring of the 76 guards from both facilities who were laid off recently as part of Mayoar Barry's austerity program, was not addressed in the agreement.

When asked if the city would rehire the guards, or if more guards would be hired Barry said, "The city government cannot and will not spend money it does not have. That goes for the Department of Corrections . . . and anyone else."

Throughout the strike, while guards picketed the two institutions, 123 D.C. Special Operations Division police officers acted as interim guards in the strikers" absence. Corrections officals reported to inmate disturbances during the walkout.

Negotiations began at 1 p.m. at the Martin Luther King Library. After three hours there, the negotiatiors moved to the District Building where they met with Barry for an additional hour to iron out the terms of the agreement.

Although Barry had refused to meet with the strikers at first, labeling their action "illegal," he said yesterday that he decided to meet with them because "even though I cannot condome an ilegal strike . . . it had come to the point where I felt it was necessary. It was the only humane and decent thing to do."

National AFGE officials at first disassociated themselves with the wildcat strike, but city negotiators and local union officials called upon them yesterday to help settle the strike.

One union source theorized that the national union leaders' change of heart was prompted by the city's inclusion of the union when it sought unfair labor practice and contempt of court citations against the strikers.

The union source also said that he feared that union arbitration over the requested reinstatements of the 76 guards, scheudled for later this month, would be endangered.

There was an alternately festive and apprehensive atmosphere as a crowd of about 300 strikers waited outside the D.C. jail for news of an accord last night. Vendors came by to sell soft drinks and snacks to the guards, who continued chanting and marching in their protest circle into the night. When the negotiators appeared at about 9:30 p.m., strike organizers read the terms of the agreement over a bullhorn.

About three-quarters of the guards decided to go along with the terms of the agreement. The rest argued violently, screaming that the deal was a "scam" and a "sellout."

Wednesday's wildcat action was the latest incident in a six-month battle between corrections officers and Barry over the effect of city budget cuts on conditions in the D.C. correctional facilities.

In June Demczuk said the layoffs were responsible for "a general breakdown in morale andjob performance due to . . . staff shortages [and] job stress," and blamed those factors for the May 18 escape by four inmates from the jail.

Demczuk said Wednesday that the walkout was precipitated by the transfer of 16 guards from Lorton's medium-security facility to the maximum-security unit there in accordance with a U.S. District Court order directing the city to increase the number of guards at the maximum-security faclity.

The suit, orginially brought by serveral lorton inmates, had alleged that staff shortages had endangered the lives and safetly of inmates there.

Demezuk said, however, that the transfer of the guards, rather than the hiring of more guards to make up for staff shortages, violated the intent of the court order and did nothing to help staffing problems.

Demezuk said he had hoped to avoid the strike. But when negotiations between city officials and guards reppresentatives broke down after more than four hours Tuesday night, "We have no choice but to strike."

The guards began picketing the two facilities at 6:30 a.m. Wednesday and continued all day yesterday. But within 15 minutes of the start of the Wednesday picketing, city attorneys won a tempoary restraining order from D.C. Superior Court Judge Leonard Braman forbidding the strike.

However, the guards voted to ignore the court order and many tore up the copies of it that were handed to them on the picket line by corrections officials.

Only 14 of the 109 officers assigned to the day shift at the D.c. jail reported for work at 7 a.m. yesterday, a few more than on Wednesday. Of the 131 guards assigned at Lorton, 60 did not report for work, 10 fewer than Wednesday.

At a press conference on Wednesday, strike organizers outlined the following demands which they said should be met by Oct. 1:

That all 76 guards who had been laid off be rehired.

That staff levels in the jail now at 397 guards, be increased to 485.

That guards should be paid overtime to bring staffing levels up to 485 in the period before any new guards are hired.

That health and safety programs be instituted to deal with the problem of job stress.