A judge has ordered two East Oakland motels, both sued by the city after decades of prostitution and child sex trafficking, to close for a year and for the owners to pay hefty fines, according to tentative decisions issued earlier this week.

The National Lodge and the Economy Inn are expected to close by the end of July, a spokesman from the Oakland City Attorney's Office said Thursday. Alameda County Superior Court Judge Brenda Harbin-Forte on Tuesday ordered the owners of both motels to each pay $45,000 fines, Oakland's attorney fees and to cover the cost of upkeep of the properties while they are shuttered to avoid blight.

"We are elated over here. It's a great victory for families and merchants in this neighborhood," said Andy Nelsen, deputy director at East Bay Asian Youth Center, which works on neighborhood blight and violence. "There are people in this neighborhood that have been fighting against the National Lodge for 30 years."

In December 2010, the city sued the owners of the motels after years of arrests of prostitutes, some as young as 14, by undercover police officers; pimping and pandering; rapes; the shooting of a minister trying to help a prostitute escape her pimp; and assaults on women involving fists, lighters and whips. The complaint against the Economy Inn, at 122 E. 12th St., included five reported rapes, including three involving minors. The complaint against the National Lodge, at 1711 International Blvd., cites numerous police reports for prostitution involving undercover officers -- including one involving an underage girl.

In October 2011, the court ordered preliminary injunctions against both motels, requiring the owners to make improvements to security, including installing video cameras that allow police to monitor the properties. Prostitution and crime continued, according to police and neighbors.

The National Lodge is owned by the Patel family, and a phone call for comment was not returned Thursday. The Economy Inn is owned by the Khatri family, and no one was available for comment Thursday. The defendants are due back in court on July 3 for a compliance hearing.

Oakland sued the motels under California's Red Light Abatement Act, which requires motel owners to prevent prostitution at their properties and allows the city to seek a maximum one-year closure, and fines if the motels fail to meet that responsibility, according to City Attorney Barbara Parker.

"People should not have to walk a gauntlet of prostitution every time they leave the house. Kids should not have to be harassed by pimps or exposed to human trafficking as they walk to and from school," Parker said. "We will not allow businesses to make a living from the abuse and exploitation of women and girls in our community."

Alex Katz, a spokesman for the City Attorney's Office, called the move to shutter the motels "a first" for Oakland, though the owners of the Economy Inn had another motel in Redwood City that was closed two decades ago under the abatement act.