Black women serving in the United States Army are cheering revised regulations that permit hair locks, ending what critics said were years of scrutiny and confusing enforcement of rules about their appearance.

The change surfaced last month in an Army directive that focused largely on grooming policy changes related to religious accommodations. Buried in the directive was text allowing female soldiers to wear “dreadlocks/locks,” which were previously banned.

The change was made in the Army’s regulations about grooming, which are detailed in a larger collection of rules about appearance and uniforms, known as Army Regulation 670-1.

Sign Up For the Morning Briefing Newsletter

Sgt. Maj. Anthony J. Moore of the Army’s office of the deputy chief of staff for personnel said the new rules offered female soldiers another hairstyle option.

“We understood there was no need to differentiate between locks, cornrows or twists as long as they all met the same dimension,” he said, according to The Northwest Guardian, a publication of Joint Base Lewis-McChord in Washington State. “Females have been asking for a while, especially females of African-American descent, to be able to wear dreadlocks and locks because it’s easier to maintain that hairstyle.”

The Army directive says that each lock, or dreadlock, “will be of uniform dimension; have a diameter no greater than a half-inch; and present a neat, professional and well-groomed appearance.”

The change was hailed as overdue by service members who said they had labored to stay in compliance under the old rules.

“January 5, in the year of our Lord 2017, we are now allowed to wear locks in uniform,” Staff Sgt. Chaunsey Logan of Fort Stewart in Georgia said in a video posted to Facebook. In the video, Sergeant Logan said she had run afoul of the old rules and risked being removed from the Army. She found a way to comply but said she constantly worried about future episodes.

She praised the revised rules, which she said she rushed to print out, fearful they would vanish from the internet.

“For me, it wasn’t just about hair,” she said. “I am completely against blind conformity, and I’m rebellious by nature.”

A passage under the old rules was removed that prohibited twists, which were defined, in part, as “twisting two distinct strands of hair around one another to create a twisted ropelike appearance.”

Capt. Danielle N. Roach, who has been in the Army for more than 14 years, said the change ended what she described as “trials and tribulations” for those who tried to comply.

“I didn’t think it would happen before I retired,” she said in a phone interview. “When I heard it, I was like, ‘There’s no way this is real.’ It’s a shock to a lot of people.”

To stay within the previous regulations, Captain Roach got treatments that used harsh chemicals to keep her hair straight. She said she went every four to eight weeks for the treatments, which cost up to $80.

Even when she worked to stay within the regulations, there was constant scrutiny by higher-ups, she said, adding that black women felt as if they were “walking targets” because the regulations were subject to interpretation.

“It caused a lot of unnecessary stress,” she said. “It was an exhausting 14 years.”

A concerted effort was made to change the regulations, The Army Times reported.

First Lt. Whennah Andrews, a member of the National Guard, worked with Nikky Nwamokobia, who runs a natural beauty channel on YouTube, to create a video making the case for the change, The Times reported.

In 2014, Defense Secretary Chuck Hagel ordered the military to review its policies about hairstyles popular with black women after complaints that new Army regulations banning large cornrows, twists and dreadlocks unfairly targeted black women. A few months later, some of the rules were relaxed. The Marine Corps approved lock and twist hairstyles in late 2015.

Davette Mabrie, a hair stylist for 36 years who has a business in San Antonio, said some of the chemical treatments to straighten hair were so harsh they could damage hair or cause it to fall out.

“I’ve seen so many cases, it just hurts my heart,” said Ms. Mabrie, who draws about 40 percent of her business from members of the military.

She said she believed that the change in rules happened in part because a new generation — one more diverse and familiar with other races and cultures — rose through the ranks as the previous generation died or retired.

“Enough of us had complained enough that they finally got it,” she said.