By Nia Williams and Laila Kearney

CALGARY, Alberta/NEW YORK (Reuters) - Pipeline sabotage by environmental activists that shook the North American energy industry this week had its roots in a 2013 protest off Massachusetts, when two men in a 32-foot lobster boat blocked a 40,000-ton coal shipment to a power station.

Three years on, Jay O'Hara and Ken Ward, the activists involved in the "Lobster Boat Blockade", helped mastermind Tuesday's audacious attempt to shut five major cross-border pipelines which can carry millions of barrels of crude from Canada's oil sands region to the United States.

Protest group Climate Direct Action has said the action was taken to support the Standing Rock Sioux Tribe, which is protesting construction of the $3.7 billion Dakota Access pipeline carrying oil from North Dakota to the U.S. Gulf Coast over fears of damage to sacred land and water supplies.

O'Hara, Ward and a small group of climate-change activists spent months preparing for the biggest coordinated move on U.S. energy infrastructure ever undertaken by environmental protesters.

The simple plan's effectiveness highlighted the vulnerability of energy infrastructure and left policy makers and energy executives mulling how to safeguard hundreds of thousands of miles of pipeline from the growing activist threat.

In early-morning raids, around a dozen activists wearing safety coats and hard hats simultaneously broke into valve stations above the pipelines in remote locations stretching 1,600 miles (2,575 km) across four northern U.S. states.

At the easternmost site, in Leonard, Minnesota, a city of only 40 people about two hours' drive from the Canadian border, Annette Klapstein and Emily Johnston scaled a chain-link fence and used bolt cutters to unlock the shut-off valves, said Ben Joldersma, a technology worker from Seattle who drove the women to the site and filmed the action.

A similar scene played out at other stations and in minutes activists had choked off supply arteries pumping as much as 15 percent of daily oil demand in the world's largest economy.

The sites were carefully chosen for both the natural beauty of their surroundings and their technical specifications, O'Hara said. Each site was at least 10 miles from the nearest pump station, which activist research had showed lowered the spill risk during an unscheduled shut down.

"They are simply little chain-link enclosures around those valves that are sticking out of the ground," O'Hara said in a telephone interview with Reuters.

The action was a rare instance of an environmental group focusing on disrupting operating energy infrastructure. Protesters have typically targeted the development of new pipelines and plants, rather than stopping those in service.

The sites sit atop the main lines transporting crude to the United States from Canada's oil sands. Environmentalists have fought for years to stem oil sands output in favor of cleaner energy.

"We have to shut these things down now, it is no longer just about stopping new infrastructure being built," O'Hara said.

The group's preparation included questioning retired pipeline company employees and experts to devise a plan to shut down pipelines safely.

Some of the activists signed up for online safety training. Others researched the legal implications of the action and spent time scouting out remote installations as potential targets, according to Reuters interviews with the activists and their supporters.

LOBSTER TRUMPS COAL

Three years earlier, O'Hara and Ward anchored a small lobster boat at the dock in Massachusetts where the large coal tanker was due to unload, preventing it from landing.

"It was our first high-risk, non-violent civil disobedience action," said Marla Marcum, who provided on-shore support for the two men. Marcum was referring to the legal risk of the action, which could have incurred federal charges.

Buoyed by their success, Marcum, O'Hara, Ward and a fourth activist, Tim DeChristopher, plotted more action.

"We began to imagine what it was that we thought was unique ... to fill the niche that no-one else was filling in the climate movement," she said.

They founded the Climate Disobedience Center, which Marcum directs. The center provided financial, planning and legal support to the Climate Direct Action Group that executed Tuesday's sabotage.

Ward, 59, of Corbett, Oregon participated in Tuesday's raids. He had studied for but not completed a seminary degree, Marcum said.

"He is motivated from his position of faith," she said.

Three of the four have attended seminary school and the fourth is a Quaker, Marcum said. The center is not a faith-based organization, but religion played a role in spurring the group on, she said.

Wade was arrested in Anacortes, Washington, on Tuesday at the site of a valve station operated by Kinder Morgan.

Anacortes was important in the genesis of Tuesday's raids, said Afrin Sopariwala, spokeswoman for Climate Direct Action.

Ward and the other activists that switched off the valves on Tuesday all participated in a protest in Anacortes in May that blocked rail tracks carrying oil wagons to refineries, she said.

"That was pretty massive, but it still felt like we weren't breaking into the national narrative," she said.

During the planning for the rail protest, a small group including Ward came up with the idea of shutting down valves at multiple locations on a single day, she said. Ward approached others to encourage them to take part and was key in keeping the plan on track, she added.

On Tuesday, the activists called operating companies and emergency services 15 minutes before turning the valves to tell them what they were planning, and where. In response, the firms shut the entire length of the pipelines as a precaution.

In Minnesota, after shutting the valve, Klapstein and Johnston rechained the site and waited for authorities, Joldersma said. They placed a flower at the site "to symbolize the kind of world we want to live in," he added. Police soon arrived, arresting the two women, who were later charged with criminal damage and trespassing.

The two said legal methods of protesting against climate change were ineffective and without radical action the earth would be irreparably damaged.

"My fear of that possibility is far greater than my fear of jail," said Johnston in a statement posted by Climate Direct Action.

"My love for the beauties of this world is far greater than my love of an easy life."

(Additional reporting by Nicole Mordant in Vancouver; Editing by Simon Webb and James Dalgleish)