Jürgen Weber points to a lesion on the hind leg of one of his cows, a common health problem in “tie stalls”, where the animals are kept permanently restrained in one position. His herd of 30 cows face each other in two rows inside the dim, low-ceilinged barn on the side of the family home in the town of Boxberg, in the southern German state of Baden-Württemberg.

In a farming system criticised as “medieval”, each cow is held in place by a chain or strap around her neck, which restricts movement to standing or sitting. Food and water is brought to the cow, although some farmers untether the animals and allow them into a yard or on pasture for part of the day or during summer months.

German vets say keeping cows this way is a violation of the country’s animal protection laws leading to a “significant restriction of the natural behaviour of cows, lack of social hygiene and social contact with other cows”. Yet more than one third of cows in the country are still kept in this manner, particularly in southern German states such as Baden-Württemberg (30% of dairy farms) and Bavaria (60%).

“It seems strange that something from the middle ages still exists,” says Sophie Greger from the campaign group Animals’ Angels. “It’s unimaginable to modern consumers and in none of the advertising and branding.”

Farmer Jürgen Weber in Boxberg, Baden-Württemberg. Photograph: Friederike Brandenburg/The Guardian

Weber, 50, says he has no choice; his farm is stuck in the middle of a town with no additional space to build an open barn or allow his cows outside. “I think people would prefer the cows in the field, but what should I do? I have the stable and I have the milk.”

Unlike chicken cages and sow stalls, tie stalls are not a modern invention but date back to the 19th century. Modern dairy farming started this way, with stables built adjacent to the house to provide it with heat, according to Marina Von Keyserlingk, a professor in animal welfare at the University of British Columbia. “The public may have that romantic image of a milkmaid on a stool and a cow tied up, but [they] don’t think that it remained tethered all day long.”

As dairy farms grew in Europe and north America, many started using free-stall systems in which the cows are untethered. The remaining tie-stall farms are small, averaging just 20 cows, which is well below the German average of 65.

Farming groups in Germany are now joining calls for tie stalls to be banned. “We demand that tethering be ended by law so that it can be replaced by more up-to-date farming methods,” the youth wing of the German Farmers’ Association said in a statement published in late August. “It is not fit for our time. We as young farmers support the principle that healthy cows need movement. It reduces the occurrence of illness of the udder and body. In addition, the movement allows the cow to build muscle and be more fertile.”

Yet the German government continues to publicly reject calls for a ban, saying it would be a “burden on small- and medium-sized farms” and that many were already moving away from the system.

A cowshed in Boxberg. Photograph: Friederike Brandenburg/The Guardian

Opponents of a ban argue it could force many of them out of business and accelerate the shift to large-scale dairy farms. They also say farmers know their cows individually and maintain good animal welfare. Weber had two nine-year-old cows that had been through eight lactations, for example, which is well above the typical industry average of three.

“In Bavaria people see themselves as the part of Germany with a lot of tradition,” says Marie Reinke, a vet at the German NGO Albert Schweitzer Stiftung. “Keeping cows this way is part of their way of keeping tradition. People see it as part of their identity.”

BDM, an association of German dairy farmers, says it expects officials to announce a ban within the next year. It is calling for a 10- to 12-year transition period for farmers to adapt. “In reality, 80-90% of those farms using tie stalls will be gone in the next decade, but we don’t want it to stop now because they have to earn money and a living,” says BDM advisor and dairy farmer Johannes Pfaller.

Animal welfare campaigners say that is too long to wait. “There has been a big drop in recent years as older people are dying or giving up, with children that don’t want to carry it on. We know it will end in 20 to 30 years, but why do so many more have to go through it?” says Greger.

Jürgen Weber’s farm in Boxberg. Photograph: Friederike Brandenburg/The Guardian

Weber knows he will have to adapt and accepts that it would be better for the cows not to be tethered. “There are two possibilities: to build a new barn or end milk production.” Unlike some other farmers using older tie-stall systems, Weber has a 21-year-old son who wants to take over the business. “I would go work somewhere else, but my son does not want to work [elsewhere]. He says he has much more fun here and loves the cows.”

Building a new barn without tie stalls would cost Weber and his family €1.3m (£1.1m). “The bank said yes, my son said yes, but I said no. It’s a lot of money from the bank. It would take 20 years to pay back and nobody knows the milk price. That’s the big reason.”

Germany is not alone in grappling with the issue: tie stalls are common in much of Europe and north America. In Austria, more than 80% of dairy farms use tie stalls, in Switzerland it is 78% and Sweden 75%. In the US, it’s estimated to be about 40%, down from 62% in 2007.

Although not yet banned in the UK, the Red Tractor assurance scheme said it plans to phase out the method, estimating 0.3% of dairy cows in the UK are still tethered. Government rules on animal welfare in the UK state that tethered cows must be able to groom themselves, as well as being untied and allowed to exercise at least once a day.

Although the EU has no rules against the use of tie stalls, a review by the EU food safety advisors called for a ban on permanent tethering, concluding it restricted the voluntary movement and social behaviour of cows.

The town of Boxberg. Photograph: Friederike Brandenburg/The Guardian

Denmark is one of the few countries to bring in a ban on tie stalls, which will come into force in 2020. In the 1980s, more than 85% of dairy cows were kept in tethered stalls.

It is inevitable that farmers in both Europe and north America will have to accept an end to the use of tie stalls, says Von Keyserlingk. “The older generation thought as long as [the cow] is producing milk that’s all right, but now we also want to make sure we are giving the animal a good life.

“Twenty years ago the consumer did not ask those questions, but today they and retailers will. The reasonable person does not expect them to change tomorrow but to strive to change more as we learn. They need to understand that in the long run it is not acceptable.”