The deal is for $70 million and includes $43.5 million guaranteed, a source said.
"We are thrilled to reach a long-term contract agreement with Demaryius Thomas," Broncos executive vice president of football operations/general manager John Elway said in a prepared statement. "He has developed into one of the top wide receivers in the NFL, and making sure he remained a Denver Bronco was a significant priority for our team.
"Demaryius is a special talent and an elite player who has also become a team leader during his five NFL seasons. We are very much looking forward to him playing a major role in the success of the Broncos well into the future."
The Broncos designated Thomas as their franchise player earlier this year. He had not signed the one-year, $12.823 million tender and skipped the team's offseason program.
If the sides hadn't reached a deal by Wednesday at 4 p.m. ET, they would have been prohibited by NFL rules from agreeing to a long-term deal until after the 2015 season. Sources had said Tuesday that the sides had not exchanged contract proposals or had any dialogue in more than a month.
"We met with [agent] Todd France back in the end of May, first of June, and both put our offers on the table," Elway said in a news conference Wednesday. "At that point in time, there wasn't any movement until this morning, so once things got going this morning, that was the way to get a deal done.
"Until you get a deadline, it's hard to get anything going. They were where they were. We were where we were. We were able to come together."
The tender would have been guaranteed the moment Thomas signed it, but he wanted a long-term deal and believed he would get one. Elway also wanted to get a deal done with Thomas so "he can be a Denver Bronco for a long time."
Thomas is a team captain and three-time Pro Bowl selection, so the talks were being watched closely by his teammates. Quarterback Peyton Manning was among several Broncos players who had said they hoped Thomas would get the deal he deserved.
Much of the discussions centered on guaranteed money and when Thomas would receive it.
The Broncos had made enough progress on the deal that they shipped Thomas the playbook and practice video to see the new offense under first-year coordinator Gary Kubiak. Thomas was also regularly in touch with wide receivers coach Tyke Tolbert and Manning.
Kubiak said during the offseason program he was "very confident" a deal would be done.
Thomas told ESPN.com earlier this year he considered himself among the league's elite at the position and added, "I hope the Broncos agree."
The new deal puts him among the league's highest-paid receivers. Dez Bryant of the Dallas Cowboys, who also was designated as a franchise player earlier this year, signed a five-year, $70 million deal, with $45 million guaranteed, on Wednesday, sources said.
Denver, in a statement released Wednesday, also denied reports that they had colluded with the Cowboys as the teams worked on deals for their respective receivers.
"The suggestion that our club may have colluded with another team about a negotiation is completely false and without any merit," the Broncos said.
The Broncos were monitoring the Bryant-Cowboys situation, however.
"We had our numbers set up and figured out what we believed was correct value for us, for the Broncos as well as Demaryius," Elway said. "It just took awhile to get to that point. Anytime you have two special football players at the same position that are going into a franchise year, there's always caution that nobody jumps the gun."
Since the start of the 2011 season, Thomas, 27, is second in the NFL with 28 100-yard-receiving games in the regular season and postseason combined. Last season he posted 10 100-yard games, including seven in consecutive weeks. His 226 yards in the Broncos' Oct. 5 win over the Arizona Cardinals is a single-game franchise record. His 1,619 receiving yards last season also set a single-season franchise record.
With Manning at quarterback, Thomas has had three consecutive seasons with at least 92 receptions, 1,430 yards receiving and 10 touchdowns. He is only the third player in league history to have three consecutive seasons of at least 1,400 yards receiving and at least 10 touchdowns; Jerry Rice and Marvin Harrison are the others.
"You look at the production DT has had the last three years, and I don't think there's any question DT is one of the top wide receivers in the league, and he's being compensated that way now," Elway said. "It's very well deserved on DT's part. We have high expectations. I think he's coming right into his prime. We don't anticipate him backing up at all. Expectations are going to be increased now. We just think he's got all the skills, and with the type of person he is, he's the type of player and guy we want on the Denver Broncos. We have a tremendous amount of confidence in DT, and it's why we felt comfortable paying him this kind of money."
The Broncos have now signed their past three players to carry the franchise player tag to long-term deals just before the deadline; tackle Ryan Clady and kicker Matt Prater were the others. Thomas' deal gives the Broncos the franchise player tag back, so it is available to use on linebacker Von Miller, whose contract is set to expire after the 2015 season.
The two sides worked on the deal avoiding, for the most part, the back-and-forth banter in the court of public opinion. The only real testiness, at least publicly, came before the draft, when Elway was asked about Thomas skipping the team's offseason program.
At the time Elway said: "To be dead honest with you, I see absolutely zero value with him being away from here. Zero value, for him."
Elway added, at that time, he believed Thomas' absence had "zero effect" on the negotiations from either side.
Elway said Wednesday that the Broncos will be cautious with Thomas as he rejoins the team.
"We'll just have to be careful with DT when he comes in to training camp and really manage him and get him up to speed with what we're doing mentally but also physically because he didn't have the OTAs or the minicamps with us," Elway said. "We'll have to be able to monitor that very closely and make sure we get him up to speed and don't take any unnecessary risks with him."
For his part, Thomas was low-key in his public appearances, which included a recent football camp he organized in Georgia.
Thomas is scheduled to have a football camp in Denver on Saturday and Sunday.
The signings of Thomas and Pro Bowl cornerback Chris Harris Jr. in December (five years, $42.5 million) constitute Elway's answer to what had been a growing list of departing free agents. Wide receiver Eric Decker, guard Zane Beadles, guard Orlando Franklin, tight end Julius Thomas, safety Rahim Moore and defensive tackle Terrance Knighton are among the players who were not re-signed by the team. All but Knighton were Broncos draft picks.
ESPN Chiefs reporter Adam Teicher contributed to this report.