RIYADH, Saudi Arabia — Saudi Arabia on Tuesday announced that women will be allowed to drive for the first time in the ultra-conservative kingdom next summer, fulfilling a key demand of women's rights activists who faced detention for defying the ban.

The kingdom was the only the country in the world to bar women from driving and for years had garnered negative publicity internationally for detaining women who defied the ban.

The move, which has been welcomed by the United States, represents a significant opening for women in Saudi Arabia, where women's rights have steadily and slowly gained ground over the years. Saudi women remain largely under the whim of male relatives due to guardianship laws.

King Salman and his young son and heir, Crown Prince Mohammed bin Salman, have tested the waters though, allowing women into the country's main stadium in the capital, Riyadh, for national day celebrations this month. The stadium had previously been reserved for all-male crowds to watch sporting events. The king and his son have also opened the country to more entertainment and fun.

Women's rights activists since the 1990s have been pushing for the right to drive, saying it represents their larger struggle for equal rights under the law.

Some ultraconservative clerics in Saudi Arabia, who wield power and influence in the judiciary and education sectors, had warned against allowing women to drive. They argued it would corrupt society and lead to sin.

Women in Saudi Arabia have long had to rely on male relatives to get to work, run errands and simply move around. The more affluent have male drivers and more recently, in major cities, women could access ride hailing apps like Uber and Careem.

The state-run Saudi Press Agency and state TV reported the news late Tuesday evening, saying King Salman decreed that both men and women to be issued drivers' licenses.

Women, however, will not be allowed to obtain licenses immediately. A committee will be formed to look into how to implement the new order, which is slated to come into effect in June 2018.

The kingdom had held out on allowing women to drive, despite a number of social openings and gains for women, including granting women the right to vote and run in elections for the first time in late 2015.

State Department spokeswoman Heather Nauert said the U.S. is "happy" with the move, calling it "a great step in the right direction for that country." She did not comment on whether Saudi Arabia still needs to do more to ensure full rights for its female citizens.

Batrawy reported from Dubai, United Arab Emirates. Associated Press writer Josh Lederman in Washington contributed to this report.