MIAMI -- What looked to be dead in the water in November became a reality on Thursday afternoon: Josh Johnson is staying with the Marlins long-term.

The two sides agreed on a four-year, $39 million contract that is the first of its kind in the Jeffrey Loria era. It keeps one of the game's best young pitchers in the books through the 2013 season, taking care of his last two years of arbitration before increasing significantly in value to give Johnson security through his first two free-agent seasons.

And it gives the 25-year-old right-hander what he's wanted all along.

"My No. 1 goal was to stay here," Johnson said in a phone interview on Thursday. "I wanted to stay here longer than one or two years. This means everything to me, to know that I'm going to be a Marlin, [that] I'm going to be there for the opening of the new stadium."

Back in late November, his agent, Matt Sosnick, said talks with the low-budget Marlins on a long-term deal were all but done because Florida declined to guarantee a fourth year in the contract. But the Marlins have seemingly changed their minds, and now Johnson will join star shortstop Hanley Ramirez -- who signed a six-year, $70 million pact in May 2008 -- as players who will be under contract when the team moves into its new ballpark in 2012.

On Tuesday, the Marlins, the Office of the Commissioner of Baseball and the Major League Baseball Players Association issued a joint statement saying they had reached an agreement on the Marlins' "continued compliance" in the use of revenue-sharing money in accordance with the Basic Agreement. In a statement, MLBPA executive director Michael Weiner added that the Marlins "plan to use such proceeds to increase player payroll annually as they move toward the opening of their new ballpark."

Florida has yet to announce the deal, but Johnson has agreed to be paid $3.75 million in 2010, $7.75 million in '11 and $13.75 million in each of the final two years.

Johnson's deal is the second largest for a pitcher headed into his second year of salary arbitration. It tops the four-year, $38 million contract Zack Greinke signed with the Royals last January -- believed to be the framework of what Johnson's agent was looking for -- and it falls just below a four-year, $40 million contract Johan Santana signed with the Twins in 2005.

He is also the first Marlins pitcher inked to a long-term deal under Loria.

On the day he signed his extension, Johnson thought back to a couple of conversations he had during the season with the Marlins' owner, when he promised Johnson he would get something done in the offseason to fulfill his desire to remain in South Florida.

"I took him at his word," Johnson said.

And it was that assurance that stayed in his mind throughout the winter months, even when it seemed like a long-term agreement between he and the Marlins would not come to fruition.

Then, when that deal was finally complete, Loria gave Johnson a congratulatory call, and the righty responded, "I knew you would stick to your word."

Johnson, who turns 26 on Jan. 31, finished the 2009 season 15-5 with a 3.23 ERA in 33 starts, striking out 191 and walking 58 in 209 innings while making the All-Star team for the first time. Since returning from Tommy John surgery in July 2008, the Oklahoma product is 22-6.

At 6-foot-7, Johnson is armed with a dazzling slider, fastball and changeup that project him as one of the best young arms in the game. He proved that during a rookie season in '06 that saw him finish fourth for the National League Rookie of the Year Award, and he proved it again when he returned from major surgery in '08 and went 7-1 with a 3.61 ERA in his final 14 starts of the season.

For his five-year career, Johnson -- the Marlins' fourth-round Draft pick in '02 -- is 34-16 with a 3.40 ERA.

Back when talks stalled in November, Sosnick told MLB.com, "We're to the point right now where I've kind of moved on."

But negotiations progressed to the point where the two sides began toying with the idea of a multiyear contract once more. And hours before the deal was agreed upon, a more-at-ease Sosnick said he was "cautiously optimistic" a long-term contract would get done.

"It happened real quick," Johnson said. "Over the last couple of days, talks went back and forth, and then, boom-boom, it got done."

The reason the deal didn't die had a lot to do with Johnson's desire to stay in South Florida. Apparently, the Marlins felt the same way.

"This means everything," Johnson said. "I now have security for my family, my wife's family and my children's children.

"You don't want to start the season with all those questions."

But the Marlins still have questions of their own before they start the season, and it mainly revolves around six arbitration-eligible players -- Cody Ross, Jorge Cantu, Dan Uggla, Renyel Pinto, Leo Nunez and Anibal Sanchez.

The biggest question is Uggla, who could make up to $8 million in arbitration. The 29-year-old power-hitting second baseman has reportedly been shopped this offseason, but the suitors have dwindled. Pinto is another player for which the Marlins have reportedly been trying to find a trade partner.

Arbitration-eligible players without a 2010 contract will exchange figures with their respective teams on Tuesday, and hearings before a three-person panel will take place Feb. 1-21. Players can still negotiate with their teams up until their scheduled arbitration hearings, but Florida has a knack for not making a deal after the exchange date, making Tuesday a pretty hard deadline.

As of Thursday, the Marlins had not entered contract discussions with Ross and Cantu. But there's still time, and both figure to be part of Florida's plans for the 2010 season.

Florida could still seek more relief help and a lefty hitter off the bench after Ross Gload signed with Philadelphia.