Marcus Smart is the most tenured Celtic, and he has made it clear it would be meaningful to stretch that status deep into his career. So when the fifth-year guard entered free agency this summer and was not quickly re-signed by Boston, some doubts crept in about whether the franchise truly wanted him as much as it had let on.

“It was probably misplaced worry,” said Smart’s mentor and former high school coach, Kenny Boren. “But there’s always that angst and that worry that, ‘Oh, man, I’m going to leave a team, a coaching staff and a fan base that I love.’ So, yeah, anytime you’ve been somewhere for four years and you develop such a bond, it’s very fearful that it could all be changed overnight.”

Now, though, Smart knows he is still an important part of the Celtics’ future, and likely will be for years to come. The guard flew into Boston late Wednesday night, and on Thursday morning he and his agent, Happy Walters, met with Celtics president of basketball operations Danny Ainge and co-owner Wyc Grousbeck at the Auerbach Center, the team’s sparkling new training facility. By the end of the meeting, Smart was signing a four-year, $52 million contract. It is a fully guaranteed deal with no player or team options, according to a league source.

“At the end of the day, he was just overwhelmed and almost to tears that he’s going to be a Celtic for the next four years, and that’s actually the truth,” Boren said. “He was very moved and excited to be around for quite a while. It’s just a huge relief.”

After signing his contract, Smart went to take his mandatory physical exam at New England Baptist Hospital. He’d said earlier in the morning that he was not feeling well, and while he was completing a treadmill stress test he got sick. The rest of the physical and Smart’s scheduled press conference were both postponed, and Smart stayed at the hospital to receive IV fluids. But he is expected to be fine.

Smart’s deal puts an end to a somewhat rocky month between the two sides, with Smart growing increasingly disappointed by Boston’s lack of contact with him. Amid the apparent discord, though, the Celtics’ fondness for Smart never faded, and there was never a time when the team did not intend to bring him back.

“This is where I want to be, and I’m ready to put a green jersey back on and get to work,” Smart said in a statement released by the team. “I’m determined to help my teammates bring another championship to the best fans in the world.”

Smart was a restricted free agent, meaning Boston had the right to match any offer sheet he signed with another team. But that offer sheet did not materialize, and as free agency dragged on without a deal with Boston, sources on both sides said it was becoming increasingly likely that Smart would ultimately just accept Boston’s one-year, $6 million qualifying offer that would have made him an unrestricted free agent next season. That could have resulted in Smart departing after next season, and that is not something either side truly wanted.

“I think calmer heads prevailed,” Walters said. “Marcus of course wanted to be there, but at the same time we needed to see what was out there. The team needed to understand that Marcus was prepared to play out the qualifying offer, which he was.”

Smart arrived at the Las Vegas summer league on July 9 and took a courtside seat next to Walters for the game that followed the Celtics’ that day. It certainly appeared that he was making a statement.

Walters said that Ainge later initiated a conversation with Smart while they were there, and that it went well. He said there had mostly been rolling dialogue since then, and that the two sides were never really far apart. Walters said that the presence of Grousbeck, the team’s co-owner, was important at today’s final meeting.

Smart averaged 10.2 points, 4.8 assists, and 3.5 rebounds per game last season. The 24-year-old guard has the ability to change games with his relentless and sometimes even reckless play, although scoring remains a weakness, as he made just 36.7 percent of his shots and 30.1 percent of his 3-pointers last year.

But coach Brad Stevens had consistently said that he does not worry about those numbers, because Smart’s impact on a game elsewhere is invaluable.

Unless the Celtics make other moves to shed salary — and there is no sign of a desire to do that at this point — Smart’s deal will put Boston into the luxury tax next season. With Kyrie Irving becoming a free agent after next season and rookie deals for Terry Rozier, Jaylen Brown and, eventually, Jayson Tatum coming to an end, it was all but inevitable that the Celtics would become a tax team, and ownership has publicly stated that it would not shy away from paying up to build a title contender.

Entering the tax this year would mostly be significant because it could start Boston’s clock on becoming a tax repeater, which occurs when a team is in the tax for three out of four years and results in an even costlier bill. Nevertheless, team ownership did not blink.

Now that this deal is done, Boston’s roster is almost complete. The Celtics have 14 players under guaranteed contracts for next season. Abdel Nader’s partially guaranteed deal seems like a long shot to be picked up prior to the Aug. 1 deadline. The Celtics could look to sign second-year guard Jabari Bird, who thrived in summer league after playing his rookie season on a two-way G-League contract. But they could just keep the spot open for now to maintain roster flexibility. Boston will have the $5.3 million taxpayer’s mid-level exception at its disposal if it decides to make a move.