WASHINGTON — The United States will provide Israel's military with $38 billion during the next 10 years, officials said Tuesday, the largest batch of military assistance the U.S. has ever pledged to another country.

Following months of behind-the-scenes negotiations, the State Department said the two countries had reached a 10-year agreement, with a signing ceremony planned for Wednesday. The U.S. and Israel haven't disclosed the exact sum, but officials familiar with the deal said it totals $3.8 billion a year — up from the $3.1 billion the U.S. gave Israel annually under the previous 10-year deal.

Obama's national security adviser, Susan Rice, planned to attend the ceremony at the State Department, a senior Obama administration official said. Israel's acting national security adviser, Jacob Nagel, arrived in Washington ahead of the announcement and was also expected to attend.

Israeli Prime Minister Benjamin Netanyahu's office confirmed in a brief statement that a deal had been reached, but offered no additional comment.

Under the agreement, Israel's ability to spend part of the funds on Israeli military products will be gradually phased out, eventually requiring all of the funds to be spend on American military industries. Israel's preference for spending some of the funds internally had been a major sticking point in the deal.

The new agreement also eliminates Israel's ability to spend a fraction of the funds on fuel for its military. In another apparent concession, Israel has agreed not to ask Congress to approve more funds than are included in the deal unless a new war breaks out, said the officials, who weren't authorized to discuss the details publicly ahead of a formal announcement and requested anonymity.

The agreement concludes many months of negotiations that involved a delicate calculation by Jerusalem about whether to strike a deal with the outgoing U.S. president. In February, Netanyahu quietly floated the prospect of waiting for Obama's successor in hopes of securing a better deal.

But the Obama administration has been eager to lock in the agreement before leaving office to help bolster Obama's legacy and undercut the criticism that his administration was insufficiently supportive of Israel.

Obama's relationship with Netanyahu has been famously fraught for years, and ties between the countries worsened significantly when the U.S. and world powers struck a deal with a nuclear deal with Iran. Israel considers a nuclear-armed Iran to be an existential threat and disagreed sharply with Obama's contention that the deal actually made Israel safer by limiting Iran's nuclear program.

Israeli officials have said predictability about U.S. aid is important to help its military plan ahead. Securing the deal ahead of the U.S. presidential election in November also ensures that Obama's successor won't have to delve into the issue during his or her first few months. Both Republican Donald Trump and Democrat Hillary Clinton have vowed to protect Israel's security if elected.

The new U.S.-Israel deal also includes, for the first time, funding for missile defense programs. Under the previous arrangement, Congress approved funds for missile defense separately and on an annual basis.

The American Israel Public Affairs Committee, the largest pro-Israel lobbying group, praised Obama for completing the deal and said it would send "a strong message of deterrence" to Israel's enemies.

"With these funds, Israel will be able to modernize and better equip its armed forces," the group said in a statement.

Yet the agreement triggered pushback from pro-Palestinian groups, who said the U.S. shouldn't reward Israel with unprecedented aid despite its settlement-building in the disputed West Bank. The Palestinians have demanded that construction stop before restarting peace talks, and the U.S. considers the settlements illegitimate.

Last week, the U.S. was incensed by a video Netanyahu released in which he equated criticism of settlement-building to support for "ethnic cleansing." Netanyahu said it was "outrageous" that Palestinians wanted their future state to include "no Jews" and rejected the notion the settlements were an obstacle to peace. The State Department said it strongly disagreed with Netanyahu's characterization, calling the reference to ethnic cleansing "inappropriate and unhelpful."

Congress must still formally approve the funding each year, but is expected to put up few roadblocks. Both parties in Congress have sought to outdo each in with displays of support for the Jewish state. The previous 10-year agreement is set to expire in 2018.

Netanyahu and Obama both plan to be in New York next week for U.N. General Assembly meetings, but officials have not announced any plans for formal meeting.

___

AP Diplomatic Writer Matthew Lee in Washington and Josef Federman in Jerusalem contributed to this report.