U.S. lawmakers granted formal recognition to the Little Shell Tribe of Chippewa Indians on Tuesday and directed federal officials to acquire land on the tribe’s behalf, following a decades-long struggle by its members scattered across the Northern Plains of the U.S. and Canada.

A provision to recognize the tribe and make it eligible for millions of dollars annually in federal assistance was included in a defense bill approved in the Senate on a vote of 86 to 8. The measure now goes to President Donald Trump to be signed into law.

Most of the tribe’s more than 5,000 members are in Montana, descendants of Native Americans and early European settlers.

They have a headquarters in Great Falls, Montana but have been without a recognized homeland since the late 1800s, when the tribe’s leader, Chief Little Shell, and his followers in North Dakota broke off treaty negotiations with the U.S. government.

Tribe members later settled in Montana and southern Canada, but they struggled to stay united because they had no land to call their own.

Formal government recognition gives cultural validation to a tribe whose members have long lived on the fringes of society and were sometimes shunned by whites. More practically, it makes its members, many of them poor, eligible for government benefits ranging from education and health care to housing.

“It’s truly amazing. I’m almost speechless that this has finally come to fruition for us,” Little Shell Chairman Gerald Gray said. “Besides the dignity part and us fighting for this for over 150 years, it’s going to provide access to services our people have never had access to but have always deserved”

Providing services to the tribal members through the Bureau of Indian Affairs and Indian Health Service would cost roughly $40 million over five years, or about $8 million a year, the Congressional Budget Office said in a March report. That figure was based on an enrollment of roughly 2,600 members, a number that Gray said was outdated and too low.

Tribal leaders first petitioned for recognition through the Interior Department in 1978. Members trace their other attempts back to the 1860s, when the Pembina Band of Chippewa signed a treaty with the U.S. government.

Recognition was granted by the state of Montana in 2000, but denied by the U..S. Interior Department in 2009.

In this Oct. 29, 2019, photo, Senate Majority Leader Mitch McConnell of Ky., walks to the podium Oct. 29, 2019, on Capitol Hill in Washington.

Montana U.S. Sen. Jon Tester, a Democrat, said he worked with Montana Republican Sen. Steve Daines to convince Senate Majority Leader Mitch McConnell to get language recognizing the tribe into the defense bill.

“There were no deals cut here,” Tester said moments after Tuesday’s vote. “This happened because Leader McConnell made it a priority.”

Daines said the Senate vote marked a “historic day for the state of Montana” and had been one of his main priorities.

Legislation recognizing the tribe was approved by the House last year but later blocked in the Senate.

 Tester said a similar measure was the first piece of legislation he introduced after being first elected in 2006. Daines and Republican Rep. Greg Gianforte, Montana’s sole member of the House, also took up the Little Shell’s cause after taking office.

The House passed the defense bill with the Little Shell provision included in a vote last week. It calls on the U.S. Department of the Interior to acquire 200 acres (80 hectares) for the Little Shell’s members that could be used for a tribal government center, health clinic, housing or other purposes.

Gray said the tribe will work in coming months to identify the location of that land. The legislation says is must be within a four-county area of north-central Montana that includes Great Falls.

“It’s going to take some time,” Gray said. “We want to build a nation and you’ve got to get it right.”