OTTAWA -- A U.S. border officer who commits an on-duty crime in Canada would generally face justice in an American court under a new binational agreement.

But if the crime is murder, terrorism or sexual assault, a trial could take place in Canada, according to the agreement made public this week.

The fine print of the deal, tabled in Parliament, sets out a complex regime for determining officer accountability on both sides of the border under the Canada-U.S. preclearance scheme.

The arrangement will expand the American customs presence on Canadian soil and is expected to see Canada establish similar operations in the United States.

Currently, passengers flying to American cities through eight major Canadian airports can be precleared there by U.S. Customs and Border Protection officers. The new arrangement expands the concept to land crossings and rail and marine services, with the aim of making travel between the two countries more speedy and secure.

In the rail mode, for example, this could mean preclearing passengers and their luggage in Canada before travellers leave the train station, thereby avoiding a stop at the Canada-U.S. border, the federal government says.

Mutual respect of both countries' sovereignty and laws is "a fundamental principle" of the agreement, Public Safety Canada said in response to questions about the accountability provisions.

In general, the U.S. would have primary jurisdiction over its preclearance officers for offences committed while performing official duties in Canada. Canada, meanwhile, would have primary criminal jurisdiction over acts committed by U.S. preclearance officers outside of work, including when they are commuting to and from the job.

However, Canada would have jurisdiction over "serious cases of on-duty conduct, notably cases of murder, aggravated sexual assault and terrorism," in cases where U.S. officials agree such charges are warranted under U.S. law and Canada has asked Washington to waive its jurisdiction.

In other serious cases of on-duty conduct, the U.S. would have jurisdiction but Canada could ask the Americans to waive it.

The arrangement is reciprocal, so the same principles would apply for any Canada Border Services Agency officers performing preclearance duties on U.S. soil.

A binational council of senior Canadian and U.S. officials will meet regularly to monitor implementation of the criminal liability framework, Public Safety says.

Josh Paterson, executive director of the British Columbia Civil Liberties Association, says the wording allays some concerns about how criminal acts by U.S. officers would be handled.

However, the association has questions about how Canadians might seek redress for less serious infringements of their rights by U.S. officers, such as inappropriate use of force or unreasonable searches.

"I don't see an answer to that in this agreement," Paterson said. "How are those issues going to get resolved for Canadians?"

The association also has concerns about provisions that allow U.S. officers to carry guns in Canada during land, rail and marine preclearance operations -- though not in Canadian airports.

"In most settings where these officers are operating, Canadian law enforcement is close at hand," Paterson said. "It seems to be going too far to offer these U.S. agents the ability to carry firearms and to use them on Canadian soil."

The entire preclearance scheme is "an affront to Canadian sovereignty," said Green party Leader Elizabeth May.

It is important to move goods and people across the border efficiently, she said, but "it doesn't require U.S. officials on Canadian soil, U.S. border agents carrying guns."