United Services Life Insurance Co. of the District has agreed to buy North Dakota's second-largest insurance underwriter for more than $32 million in a transaction that is expected to be completed before the end of the year.

The purchase of Provident Life Insurance Co., a subsidiary of Equitable of Iowa Companies, is subject to execution of a definitive agreement and approval by regulatory agencies.

United Services will pay Equitable $24.8 million in cash and the balance in a 30-day note for $7.25 million, payable in cash or securities. Among the securities that may be tendered in total or partial payment of the note are more than 1 million shares (14.27 percent) of common stock that United Services owns in Sovereign Corp., a holding company based in Santa Barbara, Calif.

Based on the sale and certain reinsurance transactions between Equitable and Provident, however, Equitable will realize $42.1 million from the deal.

Provident, which is based in Bismarck, N.D., operates in 31 states, primarily in the West and Midwest. It had total assets of $150.3 million and revenues of $26.5 million in 1981.

United Services and its subsidiaries have more than $9.3 billion of life insurance in force and assets of more than $652 million. It operates in 49 states, Europe and Japan and is licensed as a re-insurance carrier in New York.

In an unrelated transaction involving another local insurance company, Home Casualty and Surety Co. of the District has been purchased by AFIA Finance Corp. of New York, officials have confirmed.

AFIA, which is a holding company for several large carriers doing business overseas, acquired HCSC from a group of investors for $1.5 million.

The holding company said it bought HCSC because it wanted a domestic insurance company for licensing in provinces overseas.

HCSC was an affiliate of Firemen's Insurance Co. of Washington, which W. R. Berkley Corp. of Cos Cob, Conn., bought in April for about $6 million.