PEMBINA, N.D.-An environmental activist who shut off an emergency valve on the TransCanada Keystone oil pipeline was sentenced Tuesday to spend one year in prison.

Michael Eric Foster, 53, of Seattle, initially was charged with eight different crimes for his participation in the 2016 action that targeted a section of pipeline that runs through northeast North Dakota. Foster was joined on trial by co-defendant Samuel L. Jessup, of Winooski, Vt., a fellow "valve-turner" who livestreamed Foster's actions at the pipeline for viewing on the Internet.

Both men were found guilty by Pembina County Court Judge Laurie A. Fontaine in October. Foster ultimately was convicted of criminal trespass, a misdemeanor, and the Class B felonies of criminal mischief and conspiracy to commit criminal mischief. Jessup also was convicted of that latter crime, as well as the misdemeanor of conspiracy to commit criminal trespass.

For his three convictions, Foster was handed a three-year prison sentence with two years deferred. He faced a maximum possible sentence of 21 years in prison. Jessup-who could have seen as many as 11 years in prison-was sentenced to serve two years in prison with both years deferred. Jessup also has been placed on supervised probation.

Both men were part of a group called Climate Direct Action. Their activities in North Dakota, near the town of Walhalla, were part of a national protest against oil pipelines.