A group protesting the Dakota Access oil pipeline has set up teepees on the National Mall near the Washington Monument in Washington, Tuesday, March 7, 2017. A federal judge declined to temporarily stop construction of the final section of the disputed Dakota Access oil pipeline, clearing the way for oil to flow as soon as next week. (AP Photo/Andrew Harnik)

BISMARCK, N.D. (AP) — A federal judge declined Tuesday to temporarily stop construction of the final section of the disputed Dakota Access oil pipeline, clearing the way for oil to flow as soon as next week.

The Standing Rock and Cheyenne River Sioux tribes pledged to continue their legal fight against the project, even after the pipeline begins operating.

The tribes had asked U.S. District Judge James Boasberg in Washington to direct the Army Corps of Engineers to withdraw permission for Texas-based developer Energy Transfer Partners to lay pipe under Lake Oahe in North Dakota. The stretch under the Missouri River reservoir in southern North Dakota is the last piece of construction for the $3.8 billion pipeline to move North Dakota oil to Illinois.

The tribes argued that a pipeline under the lake violates their right to practice their religion, which relies on clean water, and they wanted the work suspended until the claim could be resolved.

When they filed their lawsuit last summer, the tribes argued that the pipeline threatens Native American cultural sites and their water supply. Their religion argument was new, however, and disputed by both the Corps and the company.

Boasberg in his ruling Tuesday said the tribes didn’t raise the religion argument in a timely fashion. He also questioned its merit.

“Although the tribe’s members may feel unable to use the water from Lake Oahe in their religious ceremonies once the pipeline is operational, there is no specific ban on their religious exercise,” he said.

The judge’s decision came as American Indians from across the country gathered in Washington to protest President Donald Trump’s policies encouraging oil pipelines. Native Americans are planning four days of activities including lobbying lawmakers and culminating in a march on the White House. Tribal members and supporters plan to camp each day on the National Mall, with teepees, a ceremonial fire, cultural workshops and speakers.

“Trump and his friends at Big Oil have not won,” Standing Rock Sioux Chairman Dave Archambault said in response to Boasberg’s ruling, adding that “the bigger legal battle is ahead — we stand strong.”

Standing Rock attorney Jan Hasselman and Cheyenne River attorney Nicole Ducheneaux said they hadn’t decided whether to appeal Boasberg’s ruling. In the meantime, they said, they’ll continue to argue for more environmental study and for the government to recognize the tribe’s treaty rights to clean water.

They don’t expect a court hearing until at least April — long after pipeline operations are expected to begin — but Boasberg “can order the pipeline turned back off, and that’s what we’ll be asking for,” Hasselman said.

Work under Lake Oahe had been held up in the courts until Trump last month instructed the Corps to advance construction. The Army is involved because its engineering branch manages the river and its system of hydroelectric dams, which is owned by the federal government.

The company began drilling under the lake Feb. 8. Company attorney William Scherman said in court documents that the pipeline could be moving oil as early as next week, and company spokeswoman Vicki Granado said it could be fully operational about three weeks later.

The MAIN Coalition, an industry group made up of agriculture, business and labor entities that benefit from Midwest infrastructure projects, praised Boasberg’s ruling paving the way for the project’s completion. The decision “further demonstrates that both the Army Corps of Engineers and Dakota Access have fully complied with all established laws and regulations,” spokesman Craig Stevens said.

The pipeline saga has endured for months. Hundreds and sometimes thousands of pipeline opponents who sided with tribal opposition to the pipeline camped on federal land near the drill site for months, often clashing with police. There have been about 750 arrests in the region since August. Authorities last month closed the camp in advance of spring flooding season and set up roadblocks to prevent protesters from returning.