The shooting of schoolgirl Malala Yousafzai by the Taliban in Pakistan shed renewed attention on the plight of women in this corner of the world. Malala survived, thankfully, and is now in the UK receiving treatment. But across the border in Afghanistan, many women are beaten, raped and executed.

Even a decade after the fall of the Taliban – during which £30bn has been spent on aid to Afghanistan – the freedom and rights of Afghan women are under grave threat.

UK aid has achieved much in Afghanistan. Millions of children are now in school, markets are bustling, and the government has shown some important improvements in their ability to deliver services. But the UK parliament's international development committee, which I chair, published a report on Thursday identifying the status of women as the key determinant of how much has changed in Afghanistan and what the UK government could and should do to maintain the gains that have been made.

Afghanistan remains one of the worst places in the world to be a woman. Although great progress has been made in improving the rights of women – notably bringing down maternal mortality and getting girls into school in the early years – these gains are under threat.

While some have argued that the Taliban have softened their stance on women, recent developments suggest otherwise. The Taliban are a divided force, with some wanting to be part of change while others maintain a hardline stance forcing school closures and worse. Students in Kandahar were forced to watch as their teacher and headteacher were executed for ignoring Taliban orders to stop educating girls.

But it's not just the Taliban that are the problem. In March, President Hamid Karzai endorsed a statement from clerics that allowed husbands to beat their wives under certain circumstances. A shocking 87% of Afghan women will suffer domestic abuse in their lifetime (pdf). Those who fight back are often punished for their extraordinary courage. Hundreds of women have been locked in Afghan jails for "moral" crimes, such as running away from home after being beaten or raped. Female politicians, doctors, teachers and activists are increasingly under attack. This year, the Afghanistan Independent Human Rights Commission warned that there has been a sharp rise in so-called "honour" killings and violent attacks on women and girls.

At the same time women have told us they are determined that the gains in educational and employment opportunities will be defended. We were also given evidence that a growing minority of men recognise the benefits of having educated wives and daughters.

These brave women and girls deserve our full and unflagging support. But it is unclear how DfID delivers this. We could only find two projects funded by UK taxpayers – out of nearly 100 – that have a direct and explicit focus on women and girls. More must be spent in ways that work to secure their future, such as projects focused on education and economic opportunities as well as domestic violence shelters and support for female police and lawyers to help victims of violence.

Elections for the next president in 2014, and for parliament in 2015, will be critical to securing Afghanistan's future. Karzai cannot stand again and it is unclear who will succeed him. Women comprise more than a quarter of elected politicians – more than in many of the world's most developed democracies – but how many will be willing to risk their lives to run for office the next time around?

Women have been all but excluded from fledgling political talks, and many fear their freedom will be traded away in a deal with the Taliban.

Many British soldiers have died or been injured in the attempt to give Afghanistan a better future. The treatment of women after troops pull out in 2014 will be the litmus test of whether we have succeeded in improving the lives of ordinary Afghans. Even after the soldiers leave, we can and must do more to support them. The new DfID secretary, Justine Greening, and David Cameron, the prime minister, have a real opportunity to combat violence and discrimination against women in Afghanistan by making help for women a real focus of UK aid.