A senior official within the Taliban government has defended his decision to ban women in Afghanistan from attending universities, claiming they routinely violated dress codes and were studying subjects that ran contrary to Islam.

Nida Mohammad Nadim, the Taliban-led government’s minister of higher education, said the ban was necessary to stop genders from mixing in the universities. He also said women were violating social and religious principles within Islam as they were studying "agriculture and engineering."

"We told girls to have proper hijab but they didn’t and they wore dresses like they are going to a wedding ceremony," he said. "Girls were studying agriculture and engineering, but this didn't match Afghan culture. Girls should learn, but not in areas that go against Islam and Afghan honor."

The ban included all women nationwide to stop attending private and public universities. It was issued effective immediately and until further notice.

TALIBAN BANS WOMEN FROM UNIVERSITY EDUCATION AFTER VOWING ACCESS TO 'ALL' AFGHANS: 'THEY WERE LYING'

It was quickly met with demonstrations and protests, as well as backlash from some national sports icons, regional countries and the U.S. government.

Fellow Middle East countries of Saudi Arabia and Qatar urged the Taliban-controlled governing body to reverse the ban.

In a statement on Wednesday, the Saudi Foreign Ministry expressed its "surprise" and "regret" at the ban.

U.S. Secretary of State Antony Blinken also criticized the decision, saying the Taliban was not making strides to gain much-needed international relations should they "continue on this course."

"What they’ve done is to try to sentence Afghan women and girls to a dark future without opportunity," he told a group of reporters in Washington Thursday. "And the bottom line is that no country is going to be able to succeed, much less thrive, if it denies half its population the opportunity to contribute. And to be clear, and we’re engaged with other countries on this right now. There is going to be a cost."

SAUDI ARABIA, QATAR URGE TALIBAN TO REVERSE BAN ON GIRLS’ EDUCATION IN AFGHANISTAN

The ban comes months after the Taliban assured Fox News that "all citizens" had the right to be educated under their rule.

"They were lying," Fox News foreign correspondent Trey Yingst said Thursday during a segment of "America's Newsroom."

BIDEN OFFICIALS BRACING FOR ‘EMOTIONALLY DIFFICULT’ AFGHANISTAN INVESTIGATION: REPORT

The Taliban-led government said it would lift the ban after officials fix or resolve the clothing and subject concerns.

The government made similar promises after it banned girls from attending high schools and middle schools. Officials said classes would resume for girls once "technical issues" around uniforms and transportation were sorted, but girls have yet to return to classrooms.

The Taliban, which the U.S. Director of National Intelligence designates a terrorist group, has remained the governing authority of Afghanistan since 2021, following President Joe Biden’s withdrawal of U.S. forces from the country in August of that year.

The last U.S. service member in Afghanistan, Army Gen. Christopher Donahue, did so on Aug. 30, 2021. The Taliban took over the country 13 days later.

The terror group initially promised a more moderate rule respecting rights for women and minorities, but has mostly done the opposite over its first year in power.

In addition to the education bans, the Taliban-led government has barred women from most fields of employment and ordered them to wear head-to-toe clothing in public.

Women are also banned from parks and gyms.

BIDEN'S BOTCHED AFGHANISTAN WITHDRAWAL: WE NEED A SERIOUS INVESTIGATION ON WHAT HAPPENED AND WHY

While the decision to withdraw from Afghanistan was initiated by the Trump administration, former Secretary of State Mike Pompeo said President Biden changed the conditions by which the U.S. would agree to leave.

"The Trump administration negotiated a conditioned-based withdrawal that would keep our soldiers and civilians safe, as well as our Afghan partners and allies," Pompeo wrote in an op-ed in Aug. 2022, a year after the U.S. withdrawal.

"Unfortunately, the Biden administration ripped up our conditions-based withdrawal plan and decided to leave unconditionally, trusting the Taliban not to take advantage of the vacuum. This turned into a chaotic rush for the exit, to nobody’s surprise except for President Biden. His administration stayed the course, compounding its errors with more baffling mistakes and weakness," Pompeo added at the time.

CLICK HERE TO GET THE FOX NEWS APP

He added: "Now, after a year, the Taliban’s brutal rule is yielding predictable results. The country is facing a debt and hunger crisis. They have rolled back educational opportunities for girls and forced women to wear veils. All manners of basic human rights are being curtailed."

Taliban officials have not provided details on when they would lift their education bans.

Fox News’ Trey Yingst and The Associated Press contributed to this report.