An Alaska man who pulled off a $4 million bank caper worthy of Hollywood—but with an ending that went badly awry—was sentenced Monday to 10 years in prison on top of the seven years he spent behind bars in Mexico.

Gerardo Adan Cazarez Valenzuela was the vault manager for a KeyBank branch in Anchorage in 2011 when he cooked up a complicated scheme to rob his employer and flee the country.

According to prosecutors, Valenzuela meticulously plotted the heist and the getaway—having his brother buy him an AK-47, buying a plane ticket to Seattle for his girlfriend, and using a bogus employee training exercise to remove dual controls from the vault.

In late July of that year, he stole $30,000 from the bank and used some of the money to rent a private jet. A day later, he told his boss he was staying late to organize an ice-cream social for customers.

When everyone was gone, Valenzuela went into the vault, boxed up $4.3 million in cash, rolled it to the parking lot, drove to the private jet, and flew to Seattle—where his girlfriend was waiting for him, according to court documents. He plunked down $19,000 for a new car and headed south.

To give himself more time to get out of the country, Valenzuela set the timer on the vault lock to six days and mailed his and his galpal’s cellphones to New York to throw investigators.

He managed to drive to Mexico before the theft was discovered, but the escape ended at a checkpoint where police inspected his luggage and found $3.8 million in cash and firearms.

Valenzuela was arrested and convicted of money-laundering and firearms smuggling. After serving seven years in Mexico—in a lockup he called “the filthiest place imaginable”—he was extradited to Alaska, where he pleaded guilty.

In a pre-sentencing memo, the bank thief apologized and claimed he stole the money to pay for his father’s medical expenses.

“I accept full responsibility for my actions, and although I was heavily addicted to cocaine and alcohol, there is no excuse for how selfish and inconsiderate I was," he said.

He claimed that he left $500,000 with family in Washington state before he fled the country but that his father, now dead, was robbed, so he cannot recover and return it.

In their sentencing report, prosecutors said that story was probably false and that Valenzuela had previously admitted his brother stashed the remaining cash somewhere so he would have something to fall back on if he got caught.

They also noted that before the bank theft, Valenzuela had a line he often used on his co-workers: “You can trust me with your life, but not your money.”