* Qatar signs accord with U.S. amid Gulf dispute
* U.S. Justice Dept officials to work with Qatari prosecutors
* Travel bans, surveillance to be enforced on terror suspects (Adds new Qatar's law to fight terrorism)
DOHA/DUBAI July 20 (Reuters) - The United States will post officials at the Qatari state prosecutor's office as part of a Qatari-U.S. agreement signed this month to fight the financing of terrorism, people familiar with the matter said.
U.S. Secretary of State Rex Tillerson reached the deal with Qatar during a round of shuttle diplomacy aimed at ending a diplomatic crisis in the Gulf.
The agreement has not been approved by the four U.S.-allied Arab states which accuse Doha of aiding terrorists, charges Qatar denies.
Saudi Arabia, Bahrain, the United Arab Emirates and Egypt imposed sanctions on Qatar last month, saying the gas-rich Gulf state finances Islamist militants throughout the region.
No details about the contents of the agreement signed by Tillerson and his Qatari counterpart, Sheikh Mohammed bin Abdulrahman al-Thani, have been publicly released.
But a Western official in the Gulf who has seen the document said it specifies actions Qatar will take by the end of the year, including placing two U.S. Department of Justice officials in Qatar's general prosecution.
"They will work hand in hand with Qatar to charge individuals accused of financing terrorists," said the official, who declined to be named because of the sensitivity of the matter.
Other actions in the agreement include imposing travel bans, enforcing surveillance, and freezing the assets of individuals with suspected links to terrorism. The accord points to internationally agreed definitions of terrorism without specifying particular groups.
A U.S. Department of Justice spokesman declined to comment.
A Qatari official said that the country's general prosecutor would be working with U.S. officials but that the terms of the cooperation had not been finalized.
The deal suggests White House officials hope to use the Gulf crisis over Qatar as a way to stem alleged financing flows from the wealthy region to terrorist groups.
"It's a very strong agreement. If followed, this should achieve exactly what Trump requested in the Riyadh summit," said the Western official.
QATAR TAKING ACTION
The Saudi-led alliance cut diplomatic ties and severed all transport links with Qatar soon after a visit to Riyadh in May by President Donald Trump, who days later said Qatar was a "funder of terrorism at a very high level."
Qatar appears to be taking steps to ease the pressure.
"Since the crisis there have been arrests and increased monitoring. They (Qatar) are taking important steps," said a U.S. official in the Gulf.
Qatari officials say last week's agreement highlights their commitment to fighting extremism and say their neighbours are using terrorism as a cover for enforcing demands on Qatar that encroach on its sovereignty.
In another step to reassure allies, Qatar's emir Sheikh Tamim bin Hamad al-Thani amended the country's anti-terrorism laws in a royal decree issued on Thursday.
A statement carried by the state news agency QNA said the amendments set rules for defining terrorism, acts of terrorism, freezing funding and terrorism financing. It also allows to classify individuals and groups on two national terrorism lists that authorities will create.
The U.S.-Qatari agreement, however, did not appear to sway the Saudi-led bloc.
"Diplomacy must address Qatar's support for extremism & terrorism & undermining regional stability. A temporary solution is not a wise one," the UAE minister of state for foreign affairs, Anwar Gargash, posted on Twitter the night after the accord was signed.
The four Arab countries last month named 59 individuals and 12 organizations they accused of terrorism and links to Qatar.
That included Egypt-born cleric Yusuf al-Qaradawi, a spiritual leader of the Muslim Brotherhood, and Qatar Charity, a state body which carries out aid projects with the United Nations.
Qatar has said the list is politically motivated.
Saudi King Salman on Thursday also decreed the consolidation of counter-terrorism and domestic intelligence under a new body, in a major overhaul of the security apparatus weeks after the interior minister was ousted from the royal succession. (Editing by Noah Browning and Hugh Lawson)