During and immediately following the American Revolution, Northern states, beginning with Pennsylvania in 1780, passed legislation during the next two decades abolishing slavery, sometimes by gradual emancipation. Massachusetts ratified a constitution that declared all men equal; freedom suits challenging slavery based on this principle brought an end to slavery in the state. In other states, such as Virginia, similar declarations of rights were interpreted by the courts as not applicable to Africans.