Updated

Prosecutors on Tuesday dropped charges against a self-described pedophile who was arrested last week after he allegedly violated an order that prohibited him from being within 30 feet of children.

Prosecutors opted not to pursue charges against Jack McClellan after they determined the judge who issued the order failed to set a hearing to argue its merits and had not given the 45-year-old transient proper notice.

McClellan was released from jail Tuesday following a court hearing. A cell phone message left for him was not immediately returned.

"We determined the judge had acted improperly by failing to comply with the notice and hearing requirements for issuing a three-year order," said Nick Velasquez, a spokesman for the city attorney's office.

McClellan was arrested Aug. 13 for investigation of violating the order when he was found near a child care facility at the University of California, Los Angeles. He had a camera with him at the time, but he told a local TV station that there was not any film in it.

McClellan was arrested again — several hours later — this time for trespassing after he did an interview with the TV station on school grounds. He had been told not to return to the campus after his first arrest.

Prosecutors did not pursue the trespassing charges.

Two orders were issued by Superior Court Judge Melvin Sandvig earlier this month, which came as news to city prosecutors who believed as late as Friday there had been only one.

The first was a temporary restraining order that did not allow McClellan to come within 10 yards of children in Santa Clarita in northern Los Angeles County, authorities said. The order was sought by attorneys Anthony Zinnanti and Richard Patterson, both parents of young children in that town.

While a hearing was scheduled for Friday on that order, there was not a hearing set for the second ruling that said McClellan had to stay at least 30 feet away from every person under age 18 in California for a three-year period, Velasquez said.

Some legal experts said the second order was too broad and infringed on McClellan's constitutional rights.

McClellan is unemployed and has been living out of his car. He stirred controversy in Southern California when he arrived earlier this summer from Washington state, where he had lived with his parents.

McClellan maintained a Web site in Washington where he posted photos of children he had taken in public places. He also discussed how he liked to stake out parks, public libraries, fast-food restaurants and other areas where little girls, or "LGs," congregated.

His server took his Web site down more than a month ago.

McClellan, who said he lives on supplemental security income and suffers from depression, has maintained that he launched the site as a form of therapy and would not do anything illegal.