A beer pipeline. It sounds like an ale lover's wildest dream.

It's no longer a fantasy in the Belgian city of Bruges, where the world's first beer pipeline opened last week.

The two-mile pipe connects the Halve Maan brewery in the city's historic center with a bottling plant in the suburbs.

It's a practical solution to the logistical nightmare of having trucks thundering daily through the narrow cobbled streets of a medieval town, the brewery said.

The old town of Bruges is a UNESCO World Heritage Site. Halve Maan is one of the fastest growing breweries in Belgium, and the traffic it was generating was becoming unsustainable.

The pipeline means the brewery can stay in its current location within the town center, where it has been brewing for the past 500 years. The last beer tanker left the brewery last week, Halve Maan said.

Related: There's a bull market for ... beer!

The pipeline was partly financed by a crowdfunding campaign, which raised more than 300,000 euros ($335,000) of the four million ($4.5 million) needed. Halve Maan said it set a record for crowdfunding in Belgium.

The pipeline is 3,276 meters (2 miles) long, and runs 34 meters (111 feet) below the surface at its deepest point. It passes under the town's historic canals and ramparts. Roughly 4,000 liters of beer, enough to fill 12,000 bottles, flows through the pipeline in an hour.

It is equipped with the latest technology to ensure the quality of the beer is maintained throughout its journey. It also has a cleaning and flushing system to keep the pipe clean.