The relationship between the University of California and Los Alamos National Laboratory began as a wartime affair conducted against the tense backdrop of the race to finish an atomic bomb. The union has endured for 63 years, some of them rocky.

Wednesday marked a new chapter as the government — apparently forgiving a series of alleged financial and security gaffes — asked the university to continue managing the lab that built the atom bomb.

A UC bid, made in partnership with engineering giant Bechtel Corp., prevailed over a rival team made up of the University of Texas and defense contractor Lockheed Martin.

The government contract, put out to bid this year for the first time, is worth up to $512 million over seven years, with a provision to extend it to 20 years.

"This is a new contract with a new team, marking a new approach to the management of Los Alamos," Energy Secretary Samuel Bodman said at a news conference in Washington.

The university has run the lab since it was created in the New Mexico in 1943 as part of the top-secret Manhattan Project to build the A-bomb. But many at UC had little idea what physicist J. Robert Oppenheimer and his team were working on in northern New Mexico.

Even the man who signed the first management contract, UC Board of Regents Secretary Robert Underhill, wasn't told about the top-secret project until months later.

After the scientists' nuclear weapons were deployed during World War II, some UC leaders wanted out.

President Robert C. Sproul told regents he wanted to "get rid of bomb-making, plutonium and New Mexico," said Gregg Herken, a UC Merced history professor and author of "Brotherhood of the Bomb," an account of the men who developed atomic weapons.

Others argued in favor of keeping UC's ties to Los Alamos, particularly famed Berkeley scientist Ernest O. Lawrence, a prime mover behind the atomic bomb project. Government officials also were keen on keeping the relationship going.

"There's no question that the university was pressured by the Army to continue that contract," said Herken.

For years, the UC-Los Alamos relationship was relatively smooth, though trouble was not unknown at the lab.

In 1945, a scandal erupted when Klaus Fuchs, a German-born physicist involved in the Manhattan Project, gave the Soviet Union the main elements of the design of the atomic bomb.

But in 1999, in a case that proved a major embarrassment for the government and the lab, Los Alamos scientist Wen Ho Lee was jailed amid an investigation into possible Chinese espionage.

All but one of the 59 counts he was charged with were eventually dropped. He pleaded guilty to a single count of mishandling classified information and was released, and both a federal judge and then-President Clinton apologized for how he was treated.

The case, however, raised questions about UC's management skills. More questions followed a year later, when the lab shut down after reports that two computer disks containing nuclear secrets vanished. Investigators later concluded there was an inventory error, and that the disks never existed.

"One could argue that leading up to the University of California's problems at Los Alamos there wasn't a proper balance — science got away with being a little cavalier about security," said Sidney Drell, a physicist and member of a commission that wrote a scathing report in 1999 on the lab's security.

More gaffes followed, including alleged fraudulent charges to a lab credit card and security and inventory problems that led to a seven-month shutdown.

UC worked in recent years to turn things around, taking a more hands-on role, restructuring management ranks and implementing stricter security.

DOE officials on Wednesday emphasized that accountability on security issues was a major part of the UC bid, but they wouldn't release details, citing disclosure restrictions.

UC President Robert C. Dynes said in a statement the contract decision signaled the beginning of a new era.

Others were less was less enthusiastic.

"It's a blue Christmas for America," said former lab investigator Glenn Walp, who was fired in 2002 after alleging mismanagement, fraud and cover-up at the lab.

Walp said UC deserves praise for the work it has done in the past, "but in the last 10 years, they're just incapable of running the lab that's so important to American security."