A programme of lectures, readings, concerts and even a circus continues until 4 June.

But what makes Hay-on-Wye such an ideal location for the festival is the fact that it reinvented itself as the world's first "book town".

Straddling the English-Welsh border, Hay is a pretty town that saw a gradual decline of its traditional industries after World War II.

Even the steam railway connection to Hereford closed down as long ago as 1957.

There are some 30 bookshops in Hay

Its rebirth is due to the efforts of one man in particular - Richard Booth, an eccentric but determined entrepreneur who began by shipping in truckloads of old books from American universities in the early 1960s.

He persevered over the years with his ambition of creating a book town, even resorting to such stunts as his 1977 declaration of independence for Hay-on-Wye. Mr Booth proclaimed himself king - his horse was made prime minister.

But gradually the idea did take off.

More booksellers relocated to the town, where the disused industrial buildings were ideal for storing books. The cinema and the fire station are among those given a new lease of life, and there are now more than 30 bookshops.

Tourist attraction

In 1990, the literary festival began. It now lasts for more than a week, drawing 50,000 visitors, but Hay's appeal to book enthusiasts is a year-round attraction, with 500,000 tourists each year.

"People come from all over the world just to come to Hay and if they've come this far they intend to spend money," said Mark Westwood, who has been selling books in Hay for many years.

"They come because there are 30 bookshops here while in any other town they'll find one or two at the most. It's very busy during the summer, but as far as the more serious collector is concerned there's a market throughout the year."

While not all businesses have benefited from Hay's new-found reputation, it has at least offered great opportunities.

It's overtaken August and Christmas as the economic hotspot of the year

Festival director Peter Florence

Not so long ago, only four places in town provided accommodation - there are now more than 100.

The festival itself brings a huge concentration of visitors, and the narrow streets are bustling - the actual population of Hay is only 1,300.

The main site is a marquee on the edge of town, but locations from the cattle market to the chapel are brought into use.

"The banks a couple of years ago estimated that the increase the festival generated was about £3m overall and that's a big fillip. It's overtaken August and Christmas as the economic hotspot of the year," said Peter Florence, the festival director.

The aim now is to build on that success by using the festival as a cultural tourism tool. "We're starting a new autumn season now which is driven largely by the need for the economy here to have a winter boost," added Mr Florence.

Richard Booth is still a central figure in Hay's economic life, from his huge warehouse with half a million books to the few open-air stalls in the shadow of the castle, where customers are asked to put their money into an honesty box.

Book TownNet

But his dream, so slow to be realised, has now taken off on an international scale. There are now more than 20 book towns around the world, with another dozen in the pipeline.

Hay-on-Wye and four partners in Belgium, France, Norway and the Netherlands have joined forces to set up Book TownNet. This intranet link - partly financed by the European Union - enables them to exchange information and even sell each other's books.

Hay might be full of antiquarian books housed in historic buildings, but it still recognises the benefits that modern technology can bring.