President Reagan yesterday marked the 40th anniversary of the atomic bombing of Hiroshima by saying that the world must "ensure that the atom is never again used as a weapon of war but as an instrument of peace."

In a statement that repeated a previously rejected offer to the Soviets to witness a U.S. nuclear test, the president called upon Soviet leaders to "work with us" to reduce the superpowers' nuclear arsenals.

"We must never forget what nuclear weapons wrought upon Hiroshima and Nagasaki," Reagan said.

"Yet we must remain mindful that our maintenance of a strong nuclear deterrent has for four decades ensured the security of the United States and the freedom of our allies in Asia and Europe."

Last week, the Soviets began a unilateral, five-month moratorium on nuclear testing and invited the United States to join them. U.S. officials, saying that the Soviets had already completed their current round of testing, declined and countered with the invitation to witness a U.S. nuclear test.

Each side described the other's offer as a propaganda ploy designed to influence world opinion before a November summit between Reagan and Soviet leader Mikhail Gorbachev.

But Reagan said yesterday he still hoped that the Soviets would accept the U.S. invitation "in the spirit of good will in which it has been tendered."

"The United States will take every reasonable step to build a more peaceful world," said Reagan, who also called on all nations to "share the burden" of preventing nuclear proliferation.

The president met yesterday morning with Senate Minority Leader Robert C. Byrd (D-W.Va.), who will head a Senate delegation that is going to Moscow in early September in hopes of meeting with Gorbachev.

White House spokesman Larry Speakes said Reagan gave Byrd a letter that is "essentially a greeting and an expression of the president's looking forward" to the summit.