They were a political party formed in the wake of public outcry over an incident where some Masons in NY state were accused of kidnapping and possibly killing at fellow Mason (named Morgan) who had published an expose on the initiations.
This was in the 1820s.
The Anti-Masonic party was the most successful third-party in US history, coming in second in a Presidential election!
However, after the failure to win their bid for the highest office, the party began to unravel. The damage to Freemasonry being done, the party found that it was too divided to last.
Freemasonry would not fully recover until later in the century during a period that lead to what's now called the Golden Age of Fraternalism, and spawned countless fraternities modeled on Freemasonry and also saw Freemasonry itself return to and in many ways surpass its former strength.
That period lasted until the early part of the 20th century, and the decline that followed (esp. during the depression) didn't rebound until after World War II.