A surety who has paid the debt of his principal shall be subrogated, both at law and in equity, to all the rights of the creditor and, in a controversy with other creditors, shall rank in dignity the same as the creditor whose claim he paid.
§ 2176; Code 1882, § 2176; Civil Code 1895, § 2995; Civil Code 1910, § 3567; Code 1933, § 103-501.