A 6-mile stretch of "eHighway" has opened in Germany.

The road, inspired by electric-train lines, has cost Germany's environment ministry 14 million euros and is under testing until 2022.

Conductor rods attached to a truck's roof connect with 670-volt overhead cables, which charge the trucks as they drive.

overhead cables, which charge the trucks as they drive. Germany also spent 70 million euros developing a truck, which Siemens said will save $22,000 in fuel per 62,100 miles.

Germany's transportation ministry said up to 80% of Germany's truck traffic may soon become electrified in an effort to curb emissions.

Siemens also trialed the eHighway in Carson, California, in November 2017.

Visit Business Insider's homepage for more stories.

Germany has opened its first-ever section of "eHighway," which allows hybrid cargo trucks to charge their batteries while they are on the move.

On Tuesday, the German government introduced the technology on a 6-mile-long stretch of Autobahn near the city of Frankfurt. It uses 670-volt direct-current overhead cables that let electric trucks draw power and recharge their batteries on the go.

The program, called Elisa (electrified innovative heavy traffic on the Autobahn), is an environment-ministry-sponsored project involving the electronics giant Siemens and authorities from the state of Hesse, where it is taking place.

A truck with its extended conductor rods. hessenschau

The trucks — which have conductor rods called pantographs added to the top of the cabin — must be going less than 56 mph to successfully make a connection.

Read more: 10 cities where buying an electric car may not be worth it

When they're connected, they run on electricity alone. When they rejoin the normal highway, they switch back to their hybrid engines.

Siemens, which makes the eHighways, published this graphic. Siemens

Siemens said the technology would save a 40-ton truck 20,000 euros ($22,000) in fuel costs over 62,100 miles.

It also said that if a driver swerved to the left or right while connected to the cables, it would not detach.

The 6-mile stretch of the A5 Autobahn will be tested until 2022, after which a decision will be made on whether or not to expand the project, which has so far cost the government a total of 14 million euros.

Germany also spent 70 million euros ($77 million) to make a special hybrid truck with Scania and Volkswagen for the track.

This video from Siemens shows how the project is intended to connect sea ports with cities using the trucks and the eHighway.

Germany's transportation ministry recently published a study saying 80% of Germany's truck traffic could soon become electrified, according to Deutsche Welle.

Read more: 32 electric cars you'll see on the road by 2025

Two more eHighway tracks are already being built. One is in the northern region of Schleswig-Holstein, the other is in Baden-Württemberg, in southwest Germany.

Germany said it wanted to cut greenhouse-gas emissions by 40% by 2020, by 55% by 2030, and up to 95% by 2050, compared with 1990 levels.

Siemens also trialed the eHighway in Carson, California, in November 2017.