The details of the scandal sweeping the New York Republican Party are tawdry, sad and infuriating — and a wake-up call to a national party that is urgently seeking to make inroads among black, Latino, and young voters.

Barely two weeks after RNC Chairman Reince Priebus and New York state Republican Chairman Ed Cox held a press conference at a Black church in Brooklyn to launch the party’s ambitious, $10 million diversity campaign, FBI agents arrested Malcolm Smith, a longtime Black state legislator.

According to federal prosecutors, Smith spent months organizing cash bribes to two top city Republican officials in exchange for a slot on the ballot in this fall’s Republican primary for mayor. Unfortunately for Smith, a real estate tycoon he enlisted to make cash payments was, in fact, an undercover FBI agent, according to federal prosecutors.

The criminal complaint against Smith and five others — including a Republican City Council member and the chairman and vice chairman of two Republican county organizations — details mind-boggling details of recorded conversations and alleged handovers of envelopes stuffed with money.

All the scheming, say prosecutors, was done in the hope that Smith might secure the Republican nomination and somehow win the race for mayor in a city where Democrats outnumber Republicans 6-to-1. Smith will get his day in court, along with the five other men and women named — but the damage to the party is incalculable.

In a 100-page plan of action, Priebus and the RNC laid out a pilot project to build support among Black urban voters, and specifically declared that “big-city mayoral races provide our best 2013 opportunities for these projects.” New York can probably be crossed off that list, and the fallout will be felt in other cities as the case unfolds.

And that’s a shame. Republican leaders are right to make their case to young, urban, Black and Latino voters, and should be grooming candidates from all communities. America’s two-party system can’t function properly if the parties are racially divided.

The flirtation with the Republican Party by Smith, a lifelong Democrat — if done honestly — might have started a new conversation within Black circles about the cost and wisdom of always supporting Democratic candidates and policies. It has long been noticed that Black communities contain their share of church-going social conservatives; the GOP theory is that intelligent outreach to those voters could tilt close contests to Republicans.

That’s not likely to happen now. Smith’s troubles — and the arrest of Republican leaders accused of taking money to advance Smith’s cross-party ambitions — will supply ammunition to conservative party leaders who are skeptical about the new diversity strategy.

The scandal also weakens the argument, popular among national Republicans, that big-city Democratic political machines are corrupt and wasteful. In New York, at least, the shoe is on the other foot, with GOP party leaders in the nation’s biggest city hauled from their homes in handcuffs and facing up to 40 years in prison or more.

It now falls to New York’s Republican chairman, Ed Cox, to straighten out this mess. Cox knows his way around a scandal: As the son-in-law of the late President Richard Nixon, he had a ringside seat as the Watergate debacle unfolded.

Cox must do whatever it takes to chase any crooked characters out of his party — and try, against the odds, to continue Priebus’ outreach strategy. Doing so will be a challenge, because the next black or Latino Republican candidate will face the question: Are you another Malcolm Smith?

Editor’s note: Errol Louis is the host of “Inside City Hall,” a nightly political show on NY1, a New York City all-news channel.