The resemblance is, if anything, in the way their eyebrows arch. But that was enough for a computer hacker's caricature of the prime minister, José Luis Rodríguez Zapatero, as Mr Bean to spoil Spain's launch week as holder of the European Union's presidency.

The beaming face of Rowan Atkinson's bumbling comic fool was transplanted on to the Spanish presidency's website yesterday.

Where Zapatero's warm, smiling image should have been reassuring millions of Europeans that they were in his capable hands, the hacked website featured the radiant, if dangerously incompetent, Mr Bean. "Hi there!" was the suitably Beanish greeting to Spain's European presidency.

The parody became an instant internet hit, with Spaniards flocking to visit their new leader. "So many people were looking for Mr Bean that [the site] collapsed during the afternoon," admitted a source at Zapatero's Moncloa Palace offices.

Experts said a basic security hole involving cross-site scripting had allowed the hacker to play the joke. "The attack saw someone take advantage of a weakness in the so-called XSS code," the government's National Technology and Communications Institute said.

Spain took over the six-month revolving presidency of the European Union on 1 January.

Zapatero's team had hoped the glamour of leading the EU might help reverse a slide in the opinion polls as the country struggles with 19% unemployment.

Attempts to project him as the Barack Obama of Europe appear to have stumbled at the first hurdle. Zapatero has agreed to hand over much of the leadership role during his tenure to the EU's new permanent president, Herman Van Rompuy, and the new high representative for foreign affairs, Catherine Ashton.