OAKLAND -- Just hours before attorneys were scheduled to giving opening statements at his murder trial, an Oakland man pleaded no contest to second-degree murder in the fatal beating of a 13-year-old Oakland girl nearly 40 years ago.

Curtis Tucker, 66, faces up to seven years in prison in connection with the Aug. 9, 1974 slaying of Julie McElhiney, his attorney Susan Walsh said. His sentencing is scheduled for Dec. 12.

Tucker is required to be sentenced under laws that governed California in the 1970s when the killing occurred, Walsh said.

Julie was found dead by her mother in a bathroom of her family's East Oakland home. Tucker, an ex-convict and Army veteran, was not known to the girl's family before he was arrested and charged with her death in 2012. Police said they believed Tucker burglarized the house in 3000 block of Pleitner Avenue and sexually assaulted Julie before killing her.

Oakland police said they linked Tucker's DNA to semen stains on the girl's shirt. Tucker's DNA was in a national database for a rape arrest in Washington state in 1978. He has a prior conviction for a 1972 burglary in downtown Oakland in which he was accused of attempting to sexually attack a woman.

Tucker's murder charge originally carried special allegations that the killing occurred in the course of a lewd or lascivious act on a child and burglary, but the allegations were dismissed at a preliminary hearing last year because special allegations were not attached to murder charges in 1974, Walsh said.

Murder in the course of a sexual assault under today's laws call for the death penalty or life in prison without the possibility of parole.

Walsh said Tucker will get credit toward his sentence for the more than two years he has already served in jail since his arrest, and be eligible for more credit for work and good behavior.

"The prosecution had problems in this case. They would not have agreed to this if they didn't," Walsh said.

The prosecutor in the case was unavailable to comment Tuesday.

Contact Malaika Fraley at 925-234-1684. Follow her at Twitter.com/malaikafraley.