Derek Jeter is swinging for the fences so he can be safe at home.

The city of Tampa this week granted special permission to the Yankees icon to build taller barriers around his nine-bedroom Florida fortress to fend off nosy paparazzi and star-struck loiterers.

Tampa’s Variance Review Board agreed with Jeter – and his neighbors – that the retired shortstop should be allowed to boost his current 6-foot-high front-yard fence to 8 feet and make it opaque, the Tampa Bay Times reported Thursday.

“People hang out there,” Jeter’s rep Stephen Michelini told board members. “They come at all times of the day and night. … The neighbors themselves have become the enforcers here, and frankly, they’re getting a little tired of it.”

Jeter, 42, appeared to have the support of most locals in the ritzy Davis Islands district.

Neighbor and lawyer Brad Culpepper, a former Tampa Bay Buccaneers defensive tackle, wrote a letter to the board backing Jeter and his new wife, Hannah Davis.

Tampa mayor Bob Buckhorn lives 10 houses away from Jeter and said the neighborhood can be overrun by people gawking at the shortstop’s huge home.

“It can get bad,” said Buckhorn. “I’m sure there are a number of Christmas cards in New York with people standing in front of Jeter’s house with their family. … I can understand why he would want more privacy.”

City codes allow for a front-yard fences to be 3-feet-tall if its a solid barrier, or 4 feet tall if its chain-link or wrought iron.

Jeter had already gained board permission to raise the barrier 6 feet a couple years ago, before this week’s latest fence-boosting approval.

“It’s a residence where an individual lives and he wants to protect himself and his property,” board chairwoman Susan Long said. “I just don’t have a problem with that.”

One resident spoke out against Jeter’s bid for a taller fence, claiming it was unnecessary.

The neighbor could still appeal the board’s decision to the city council if she can show City Hall that her house is within 250 feet of Jeter’s.