A D.C. police officer arrested in a sting operation involving the purchase of supposedly stolen goods was spared jail Thursday after pleading guilty in a deal with prosecutors.

Guillermo Ortiz, who resigned from the force as part of the plea, was given a six-month suspended sentence, placed on probation for two years and ordered to pay a $2,000 fine and perform 200 hours of community service, authorities said.

Ortiz, 40, a police officer for nine years, was one of three D.C. officers arrested in March after they allegedly agreed to buy merchandise that they thought was stolen. The person who offered to sell them the goods was an undercover informant working for the department’s internal affairs unit, Police Chief Cathy L. Lanier said.

The criminal cases against the other two officers — Silvestre Bonilla and Dioni Fernandez — have yet to be resolved. They were arrested March 8, the same day as Ortiz, and remain suspended while the charges are pending.

In several purchases early this year, prosecutors said, Ortiz paid the informant several hundred dollars for an iPhone and four television sets worth a total of more than $4,000.

During one transaction, prosecutors said, Ortiz was on duty and in uniform and placed the supposedly stolen merchandise in the trunk of a marked police cruiser. Like the other officers, Ortiz was assigned to the Fourth District station in Northwest.

He pleaded guilty in D.C. Superior Court to one count each of attempting to posssess stolen property and possessing an unregistered firearm, the U.S. attorney’s office said.

In a case that Lanier described as “independent and separate” from the stolen-merchandise sting, another Fourth District officer, Jennifer N. Green, was arrested March 6 after she accepted money that she allegedly thought had been stolen in a burglary.

That case, which is pending, also involved an undercover informant working for the internal affairs unit, police said.