Martell Webster has undergone three back surgeries in four years. (Alex Brandon/Associated Press)

The stinging reality hit Martell Webster last spring. The Wizards were in the midst of an electric postseason run. They were, for once, the District’s darlings. But the pain drowned out the excitement.

Webster would wake up in agony every day. It was a struggle to get out of bed and prepare for the marquee playoff games, the franchise’s first meaningful contests in years. But there were ways to temporarily overcome the throbbing pain from the herniated disc in his lower back so he played in all 11 Washington playoff games through the discomfort and postponed surgery until June 27.

It was Webster’s third back surgery in four years. He is currently rehabbing at training camp, but is confident he can contribute to the Wizards this season as their backup shooting guard. Still, he remains mindful of the back injuries’ effect — both for his career and the long term — and he decided last spring that he doesn’t envision playing professional basketball much longer.

“I know this game is probably not going to be the healthiest thing for me if I try to stretch it out as much as a possibly can,” Webster told The Post Thursday. “So I intend to really give everything I got for these last three years of my contract and probably walk away from this game so I can be healthy.”

Webster, 27, will be 30 years old when the four-year, $22 million contract he signed with Wizards last summer expires, though it could be terminated after three years because the fourth season is not guaranteed. Webster turned pro after high school so he is already entering his 10th NBA season.

“I’ve always wanted to retire young,” Webster said. “I love this game and I respect this game, but I only want to be in it as long as I can be effective and as long as I can feel comfortable.”

The Portland Trail Blazers drafted Webster sixth overall in 2005 and he spent his first five seasons in Portland before moving on to the Minnesota Timberwolves.

Washington has revived his career. He signed with the Wizards prior to the 2012-13 season and averaged a career-high 11.4 points per game, while shooting 42.2 percent from three. He averaged 9.7 points per game last season.

But Webster has his eyes set on the future, on life beyond basketball. He said is financially stable after making nearly $34 million his first nine seasons in the league. He wants to be able to play with his kids and venture off into other interests. Those include music and film.

With his idle time following surgery this summer, Webster recorded a 13-track hip-hop album called “A.R.T.T.” (Anybody Relates to This) in his hometown Seattle under the pseudonym Sui Generis, which translates to unique in Latin. He tentatively plans on releasing it in December.

Webster has also filmed a music video for a song titled “Nature Boy,” though he wouldn’t divulge any details about the project.

“Music is just a great outlet when you have downtime just to get your mind off of things,” said Webster, who began experimenting with music as a rookie in the NBA. “Some people golf. Some people go watch movies. People have different vices and for me it’s music and film. I can’t get enough of it.”

But basketball is the focus now and Webster is unsure when he will be available. He insisted he is “ahead of schedule,” but hasn’t been cleared for contact. The Wizards said he would be sidelined three to five months after the surgery.

“More rehab than anything,” Webster said. “I pick and choose my spots to come in here and participate with the team, but mostly rehab and cardio.”

Without Webster, the Wizards will rely on Glen Rice Jr. and Garrett Temple to spell Bradley Beal at shooting guard. They will also be without their most effective three-point shooter.

Webster is eager to return, but after two previous rehabs he understands there are steps to the process and he can’t push himself beyond a certain threshold. And, ultimately, that may mean early retirement.

“I can’t keep giving my body that type of stress for very long because it’s going to have residual effects especially after I retire,” Webster said. “So then I was just like, ‘Yo, man, just really think about it. You’re going to give it your all this last contract and see how you feel. I’m not putting that I’m going to retire, but the thought has crept in and has sustained in my memory. It still is, to this day, a very, very great possibility.”