Under Virginia law, mechanic's liens take priority over the construction loan and over deeds of trust, to the extent of the value of the building. A lien will also survive foreclosure, sale of the property, and bankruptcy. The priority of liens to other liens is in reverse order of tier. Third tier mechanic's liens take priority over second tier, which take priority over first tier.
Contractors working on residential construction projects must give Mechanic's Lien Agent notice within 30 days prior to the first supply of labor or materials. Lien claimants must file a mechanic's lien within 90 days from the last day of the month in which the claimant last provided labor and/or materials and within 90 days of the project completion date. But the lien can only include unpaid amounts for the last 150 days prior to filing the lien.
The owner is only required to pay for the project once, and is only liable to subcontractors for any unpaid balance owing to the general contractor. If the owner has already paid the general contractor in full, the owner has no obligation to pay the subcontractors or suppliers. So any lien filed subsequent to that payment will fail.