US actress Shailene Woodley has been taken into custody with 27 other people during a protest at an oil pipeline construction site in North Dakota.

The 24-year-old The Fault in Our Stars actress was charged with criminal trespass and engaging in a riot, said Rob Keller, spokesman for the Morton County Sheriff's Office.

She broadcast the moment of her arrest to more than one million followers on social media.