(1) The trustee shall apply the proceeds of the trustee's sale in the following order of priority:
(a) First, the proceeds shall be applied to the costs and expenses of exercising the power of sale and of the sale, including the payment of the trustee's fees actually incurred not to exceed the amount which may be provided for in the trust deed;
(b) Second, the proceeds shall be applied to payment of the obligation secured by the trust deed;
(c) Third, the proceeds shall be applied to the payment of junior trust deeds, mortgages, or other lienholders; and
(d) Fourth, the balance of the proceeds, if any, shall be applied to the person or persons legally entitled to any remaining proceeds.
(2) Whether the proceeds are disbursed by the trustee pursuant to subsection (1) of this section or pursuant to an action described in section 76-1011.01, the payment of any attorney's fees and costs incurred by the trustee in connection with the distribution of the proceeds of the trustee's sale shall be deducted from the proceeds prior to the payment of junior trust deeds, mortgages, or other lien holders, or to any other person or persons legally entitled thereto.