When buildings or fences have existed more than 20 years fronting upon any way, street, lane or land appropriated to public use, the bounds of which cannot be made certain by records or monuments, such buildings or fences shall be deemed the true bounds thereof. When the bounds can be so made certain, no time less than 40 years will justify their continuance thereon, and on indictment and conviction they may be removed. Persons owning lands beside a highway or town way on which are buildings or fences that encroach within the limits of said way may, by a writing under seal by them signed and acknowledged and recorded in the registry of deeds for the county or registry district in which the land lies, admit to the municipal officers of the town in which said way exists the true bounds or limits of said way and the extent of their wrongful occupancy thereof. Thereafter such persons, and all claiming title under or through them, shall be estopped from asserting any right to the continuance of such buildings or fences within said limits for the full term of 40 years from the date of such deed.
23 M.R.S. § 2952