New York Knicks guard Raymond Felton waved a pistol loaded with body armor-piercing bullets at his wife during several spats in their Upper West Side pad — prompting the terrified woman to turn the gun and her estranged husband in to cops, law-enforcement sources said Tuesday.

The illegal gun’s magazine was packed with 18 of the savage bullets — with one in the chamber ready to be fired, sources said.

“It’s a bad-ass gun,” a law-enforcement source told The Post of Felton’s Belgian-made FNH Five-Seven 28mm handgun.

Felton was arraigned in Manhattan Criminal Court on Tuesday evening on one felony and one misdemeanor count of illegal weapons possession — and freed on $25,000 bond. He’s set to practice with the team Wednesday and play against the Miami Heat in Florida on Thursday.

Felton’s wife, brunette beauty Ariane Raymondo-Felton, 24, told cops that Valentine’s Day was the second time in a month that he pulled the weapon on her.

There also had been two other incidents since mid-August, she said, fueled by their fights over his alleged cheating.

“When we’d have arguments over our marriage, he’d would pull out the gun and wave it. It was obviously done to intimidate me,’’ Raymondo-Felton, who filed for divorce last week, told cops, according to sources.

One source explained, “She said, ‘He’s out doing his thing.’ Looks like he was banging some girl on the side. They were arguing about bulls–t domestic stuff.’’

Felton, 29 — who’s been struggling as a point guard with the Knicks — originally bought the gun and magazine legally in North Carolina, where he went to college, sources said.

But he never got a permit for it here. The magazine had 11 more bullets in it than would be legal here for a permitted weapon, sources said.

He kept the gun in a bag under their bed, sources said.

It’s unclear why Raymondo-Felton — a first-year student at Fordham Law School — picked Monday night to finally rat him out.

Although the pair was estranged, Felton was still living at their West 63rd Street home, sources said.

His wife waited until Felton headed to Madison Square Garden for the Knicks’ game against the Dallas Mavericks — then called her divorce lawyer, sources said.

She told the lawyer she was frightened and planned to hide the gun, but he advised her not to keep it, sources said.

Her lawyer then called Felton’s attorney and told him they’d send him the weapon, sources said.

But Felton’s lawyer balked.

“I don’t think anybody is allowed to possess an unregistered, unlicensed firearm in the city of New York, so certainly anyone who offers one to me will be told politely but firmly no thank you,” said Felton’s lawyer, Michael Stutman on Tuesday.

Stutman added that his client was both surprised and upset when his wife filed for divorce.

When Raymondo-Felton’s lawyer then demanded that Stutman get Felton to come get the weapon, Stutman protested, saying his client was on the basketball court, sources said.

That’s when Raymondo-Felton and her lawyer went to the cops with the gun.

Police called the NBA, which alerted Knicks security. They approached him after the game in the team lockerroom, and Felton eventually turned himself in with his lawyer.

“He came in with his white-shoe attorney and didn’t say a word except, ‘Hello,’ ” a source said.

Felton was initially faced a heftier second-degree weapons charge from cops — which would have likely handed him a mandatory jail term . But after his wife huddled with the District Attorney’s Office for four hours Tuesday afternoon, he was only charged with the lesser raps.

The felony charge carries a possible sentence of up to seven years, but it would be highly unlikely if he got that, given the fact that he hasn’t been placed with the gun yet and so far, it’s her word against his, sources said.

Wearing red sneakers, black pants and a black sweatshirt with the words, “We said love, no more war,’’ Felton didn’t say anything in court.

His mother and other family members and friends were in court to support him.

Additional reporting by Rebecca Rosenberg, Kevin Sheehan, Kevin Fasick and Bob Fredericks