STOCKHOLM—Telecommunications-equipment maker Ericsson and Apple Inc. reached a global license agreement that ends an almost-yearlong patent dispute between the companies.

Ericsson said that under the agreement it will be paid an undisclosed amount by Apple, along with ongoing royalties over seven years.

Details of the contract are confidential...