Are the new owners of a property liable for taxes that accrue before they purchase it, or is this the responsibility of the previous owners?
How would a real estate buyer be protected against a surprise tax bill once the sale is done?
In the vast majority of jurisdictions, unpaid property taxes give rise to a lien that runs with the land. So, the new owners have an "in rem" responsibility to pay those taxes that can be collected against them solely by foreclosing on the tax lien and seizing the property if the tax isn't paid. Whether the previous owners also have any responsibility for the unpaid property taxes depends on state law which varies and on the terms of the real estate purchase and sale contract and deed in the transaction.
Where I live, the real estate buyer is protected against a surprise tax bill once the sale is done in two main ways.
First, the title company provides insurance against unpaid real estate taxes and will deduct any potential unpaid real estate taxes from the funds provided to the seller at closing unless the country treasurer has verified in writing to them that there are no real estate tax arrears for that parcel of property.
Second, if the property is conveyed by a warranty deed that does not exclude a warranty that there are no property tax liens in existence for the relevant years, then the buyer has a right to sue the seller for the unpaid back taxes if that warranty turns out not to be true. Almost all sales of real property for full consideration between unrelated parties are carried out by a general warranty deed of this type that doesn't exclude property tax liens except for the current calendar year.
If there is no title company involved in the transaction and/or the property is not conveyed by a warranty deed (e.g. it is conveyed by a quitclaim deed), then you could still avoid this risk by checking with the county treasurer to see if any back property taxes are owed on the parcel being sold and getting a certification in writing from the county treasurer of that fact, before agreeing to close on the sale.
The title insurance company, or you, if there is no title insurance company, should also check the county real estate records normally maintained by a county clerk or recorder, to confirm that the seller really owns the property sold and that it has not been sold in a tax sale which would eliminate the back tax obligation but which would also mean that the seller no longer owns the property.