What is a contract of mortgage?
The essence of a contract of mortgage indebtedness is that a property has been identified or set apart from the mass of the property of the debtor-mortgagor as security for the payment of money or the fulfillment of an obligation to answer the amount of indebtedness, in case of default of payment.
A mortgage remains an accessory contract dependent on the principal obligation, such that enforcement of the mortgage contract will depend on whether or not there has been a violation of the principal obligation.
In case the mortgagor fails to fulfill his principal obligation, say payment of debt, what are the remedies of the mortgagee?
The case of China Banking Corporation v. Court of Appeals discussed the remedies available to the mortgagee, to wit:
Where a debt is secured by a mortgage and there is a default in payment on the part of the mortgagor, the mortgagee has a choice of one (1) or two (2) remedies, but he cannot have both. The mortgagee may:
1) foreclosure the mortgage; or
2) file an ordinary action to collect the debt.
When the mortgagee chooses the foreclosure of the mortgage as a remedy, he enforces his lien by the sale on foreclosure of the mortgaged property. The proceeds of the sale will be applied to the satisfaction of the debt. With this remedy, he has a prior lien on the property. In case of a deficiency, the mortgagee has the right to claim for the deficiency resulting from the price obtained in the sale of the real property at public auction and the outstanding obligation at the time of the foreclosure proceedings.
On the other hand, if the mortgagee resorts to an action to collect the debt, he thereby waives his mortgage lien. He will have no more priority over the mortgaged property. If the judgment in the action to collect is favorable to him, and it becomes final and executory, he can enforce said judgment by execution. He can even levy execution on the same mortgaged property, but he will not have priority over the latter and there may be other creditors who have better lien on the properties of the mortgagor.
How may foreclosure be done?
Foreclosure of real estate mortgage may be done judicially or extra-judicially.
Judicial foreclosure, a special civil action, is governed by Rule 68 of the Rules of Court and is initiated by a complaint filed with the court.
Extra-judicial foreclosure, on the other hand, is governed by Act 3135, as amended. Under A.M. No. 99-10-05-0, it is initiated by an application with the Executive Judge, through the Clerk of Court.
 Ocampo v. Land Bank of the Philippines, G.R. No. 164968, July 3, 2009.  Development Bank of the Philippines v. Guariña Agricultural and Realty Development Corporation, G.R. No. 160758, January 15, 2014.  G.R. No. 121158. December 5, 1996.  An Act to Regulate the Sale of Property Under Special Powers Inserted In or Annexed to Real-Estate Mortgages.  August 7, 2001.