Congressional and administration officials are close to a Pentagon spending compromise that would remove one of the last major obstacles to passage of all legislation needed to pay the government's bills by the Oct. 1 start of a new fiscal year.

The two sides are near agreement on the complicated Defense Department measure, according to congressional sources who declined to be identified Monday.The proposed compromise would remove some of the restrictions imposed earlier by the Democratic-controlled Congress on Reagan's cherished Star Wars anti-missile defense plan, the sources said.

But overall, the Strategic Defense Initiative, as the program is formally known, still would receive $4.1 billion, the same amount that was in the bill Reagan vetoed on Aug. 3, the sources said.

Reagan had sought $4.8 billion for Star Wars, compared to the $3.9 billion the program now receives.

Approval of a Pentagon bill is the major remaining hurdle to be cleared before Congress finishes work on all 13 appropriations bills needed to finance the government starting Saturday.

The last time all 13 spending bills were finished by the start of the new fiscal year was 1948.

House and Senate Democratic leaders are pushing to finish the bills and avoid giving the GOP and Vice President George Bush a potentially embarrassing election-year issue.

After yearlong budget battles, Congress sent the president a 1,400-page, $600 billion catchall spending bill last December, nearly three months into the present fiscal year.

In Reagan's State of the Union address, he threatened to veto any similar giant spending bills this year.