TOKYO —Japan and the U.S. have agreed in principle on guidelines for limiting immunity from Japanese prosecution for civilian workers at American military bases, following a murder case this year on a southern Japanese island involving a Marine-turned-contractor, officials said Monday.

Since July, the governments have been negotiating several points concerning U.S. civilian contractors at American bases who are subject to protection under the countries’ Status of Forces Agreement.

Japanese Foreign Minister Fumio Kishida told a news conference that the two sides have agreed on how to define what constitutes a “civilian contractor” at an American base and hope to sign the agreement “during President Barack Obama’s term.” He did not give further details.

The May arrest of the base contractor, accused of raping and murdering a 20-year-old woman, renewed outrage on Okinawa, where resentment has been simmering over the island’s heavy U.S. troop presence.

That prompted Tokyo and Washington to try to establish a clearer definition of “civilian base workers.” In July, the two sides said base contractors, now described vaguely as having a “civilian component,” will be classified in more specific terms, to exclude from preferential treatment those without skills and those who are residents of Japan, like the suspect in the April murder case.