Not often in recent years has Britain had more to crow about in the Davis Cup than Spain. Spearheaded by a trio of world No1s in Carlos Moyá, Juan Carlos Ferrero and Rafael Nadal, the Spanish have reached the final of the venerable team competition seven times since the turn of the century, winning on five occasions. Britain, meanwhile, last appeared in the final in 1978, when a team consisting of John and David Lloyd, Buster Mottram and Mark Cox lost 4-1 to the US.

But a crisis in Spanish tennis means the worm has turned. While the British, led by Andy Murray and ably backed by the resurgent James Ward, will be vying for a first semi-final appearance since 1981 when they play France at Queen’s Club a week on Friday, Spain face an arduous journey to Vladivostok, where they will play Russia.

Defeat for the Spanish – who last September tumbled out of the World Group as a third-string side slumped to a shock 3-1 loss against Brazil – is unthinkable. While victory would secure a tie against one of this year’s first-round losers, offering a potentially swift return to the competition’s top tier, a further reversal of fortune would condemn Nadal and company to a more extended stay in the relative wilderness of Europe/Africa Zone Group I. A succession of British Davis Cup captains can attest to the difficulty of escaping that sporting straitjacket.

So where has it all gone wrong for the Spanish? The problems began last September in São Paulo. With Nadal at home recovering from a wrist injury and David Ferrer also absent, Roberto Bautista Agut and Pablo Andújar occupied the two singles berths against a Brazil team led by Thomaz Bellucci, a useful player but ranked beneath both men. Even without their two star players, Spain should have had more than enough in reserve to clinch the contest. Instead, an inspired Bellucci won both his singles matches and that – combined with a not entirely unexpected win by doubles specialists Marcelo Melo and Bruno Soares – meant Spain were out of the World Group for the first time in 18 years.

At that point, all hell broke loose. First the popular Moyá resigned as Spanish captain, citing the difficulty of persuading the country’s best players to turn out. Then Ferrero – like Moyá a former world No1 and French Open winner, and a figure who would have been warmly welcomed by the players – was overlooked as his replacement. Instead, the Spanish tennis federation president José Luis Escañuela appointed Gala León, the former world No27, as Spain’s first female Davis Cup captain.

Fresh from dismissing the furore surrounding his decision to take on Amélie Mauresmo as his coach, Murray applauded the news on Twitter. The mood among the Spanish tennis fraternity was darker, however. Toni Nadal, Rafa’s coach and uncle, wondered publicly how a woman with no experience of the men’s tour could function effectively as coach given that she could not enter the locker room. Ferrer said the decision had been made too quickly and without consulting the players. Political opportunism inevitably reared its head, with Spanish parliamentarians wading into a rapidly evolving sexism debate.

León inflamed the controversy further when she declared, after what was billed as a conciliatory meeting with some of the country’s top male players in Valencia: “I’m not going to apologise for being a woman.” That comment drew a strong response from Rafa, who countered: “It seems strange to me, as Davis Cup captain, that instead of seeking union and harmony between players, captains and the federation, she has incited and fed a debate that is totally false and absurd.

“It seems unfair to me that they have wanted to shift the issue to a place that is evidently a clear issue of populism.”

Escañuela, meanwhile, the man behind the appointment, came out strongly in support of the beleaguered León. “I’m the president, and Gala León is my captain,” he said. “I don’t think any woman has the obligation to explain why she is a woman.”

Strong words, but before long el presidente would be overtaken by events. Things came to a head on the eve of Wimbledon, when Escañuela was suspended by the Tribunal Administrativo del Deporte, the Spanish government’s disciplinary committee for sport, amid questions over the whereabouts of at least €700,000 (£497,000) distributed by the Spanish federation and allegations of a “complete lack of collaboration” with auditors. Nadal bemoaned the “ugly and continuous media show” surrounding Spanish tennis, perhaps suggesting he had taken his eye off the ball well before his second-round defeat to Dustin Brown. And Nadal, Ferrer and 42 other Spanish tennis luminaries signed an open letter branding the federation’s leadership chaotic and belligerent.

His position untenable, Escañuela stood down as president on Thursday. He was immediately replaced by Fernando Fernández-Ladreda, a former vice-president of the Spanish federation, who pledged to “restore institutional and sporting normality” as a matter of priority. His first move? To sack León after what a statement described as “reflection on the benefits” of her continuing as captain for the Russia tie.

It is all an ungodly mess, and things are likely to get worse before they get better. With the Russia showdown looming, no one knows who will captain Spain in Vladivostok. Even less clear is who will play. Bautista Agut, who faces Roger Federer on Centre Court on Monday, is the only Spaniard left in the men’s singles at Wimbledon. And in news that will doubtless be a dagger through the heart for Judy Murray, Feliciano López, the world No16, is due to marry the Spanish model Alba Carrillo on the weekend of the tie. Among the invitees are Nadal, Ferrer, Fernando Verdasco and Marc López. How the Spanish must wish they could call on a player like Andy Murray.