WASHINGTON—U.S. officials said Iran hacked unclassified Navy computers in recent weeks in an escalation of Iranian cyberintrusions targeting the U.S. military.

The allegations, coming as the Obama administration ramps up talks with Iran over its nuclear program, show the depth and complexity of long-standing tensions between Washington and Tehran.

The U.S. officials said the attacks were carried out by hackers working for Iran's government or by a group acting with the approval of Iranian leaders.

The most recent incident came in the week starting Sept. 15, before a security upgrade, the officials said. Iranian officials didn't respond to requests to comment.

The allegations would mark one of the most serious infiltrations of U.S. government computer systems by Iran. Previously, Iranian-backed infiltration and surveillance efforts have targeted U.S. banks and computer networks running energy companies, current and former U.S. officials have said.