A Long Island man who inadvertently helped fund the failed Times Square bomb plot last year was sentenced today to three years’ probation and a $2,000 fine.

Mohammad Younis was also ordered to forfeit $12,000 to cover the $7,000 he passed from his brother in Pakistan to wannabe terrorist Faisal Shahzad and the $5,000 that another, unidentified person got through the brothers’ illegal money transfers.

Shahzad, who’s serving life in the slammer, confessed to using the dough to help build the dud car bomb he tried to detonate at the Crossroads of the World.

Manhattan federal Judge John Keenan said Younis’ case “is illustrative of the reason” why the informal overseas banking system known as “hawala” is prohibited in the United States.

But Keenan said “the whole key” to Younis’ sentence was the fact that he “didn’t know what would happen with the money.”

Keenan also warned Younis that he wouldn’t hesitate to lock him up — pointing out a door to the courthouse jail — if he violates the terms of his probation.

Younis, a green-card holder from Pakistan who’s married with a 12-year-old daughter, offered a brief apology in which he said, “I’m totally sorry for what I did.”