Mexican authorities have discovered a high-tech drug tunnel — featuring a rail line and solar panels to provide electricity — that reaches 336 feet into California.

The tunnel began inside a home in the town of Jacume near the US-Mexico border, according to the San Diego Union-Tribune, which cited officials at the US Border Patrol.

Border Patrol Agent Tekae Michael said the tunnel — which didn’t yet have an exit point — was likely intended to transport drugs into the US.

“Sophisticated tunnels take a lot of time and money to make,” Michael said, adding that they’re not uncommon in the area. “When we find them, they’re a pretty big deal.”

The tunnel featured a rail line, a water-pumping system and solar panels to provide juice for lighting and ventilation, according to the Border Patrol.

The shaft at the entry point was about 31 feet deep and the unfinished exit shaft went up about 15 feet without breaking through the surface.

The tunnel — which averaged about 3 feet tall and 2½ feet wide — measured 627 feet total in length.

Mexican police and military forces discovered the tunnel’s entrance during an operation in mid-September.

They partnered with the US Border Patrol, Homeland Security Investigations and the Drug Enforcement Administration to explore the passageway.

Recently, authorities also found two tunnels in the San Diego area, Michael said.

And in August 2017, Border Patrol agents found a tunnel that emerged near the Otay Mesa border after 30 people — most from China and a few from Mexico — emerged from it one day.

Michael was unsure whether Mexican authorities have made arrests in the most recent case. No arrests have been made so far on the US side, he said.