Image source: Square.

Shares of Square (NYSE:SQ) rose more than 10% in after-hours trading on Wednesday, following the release of the company's second-quarter earnings report. The small-business payments provider posted top- and bottom-line figures that exceeded both its own guidance and analyst expectations.

Let's take a closer look at the report.

Gross payment volume rose 42%

Square generated total net revenue of $439 million in the second quarter, up 41% on an annual basis, and more than the $406 million analysts had been projecting. It lost $0.08 per share, which was better than the $0.11 loss Wall Street expected.

Square's adjusted revenue, which excludes sales associated with its expiring Starbucks deal, came in at $171 million, up 54% from the second quarter last year. That was much better than the $151 million to $156 million guidance the company gave back in May.

Total gross payment volume (GPV) -- the dollar value of the goods and services Square's various partners sell using its credit card readers -- was $12.5 billion, up 42% on an annual basis. Although Square itself collects just 2.93% of this on average, Square's growing GPV suggests that more sellers are processing more payments with Square readers.

Square's products generally appeal to small businesses, but it's finding success with increasingly larger partners. In the second quarter last year, 70% of businesses that used Square processed less than $125,000 worth of sales on an annual basis. That percentage fell to just 58% this quarter. Meanwhile, the proportion of Square users that processed more than $500,000 worth of sales annually doubled from 7% to 14%.

Square generates hardware revenue from the sale of its credit card readers. Last quarter, hardware brought in $11 million, up 209% on an annual basis, but down 31% sequentially. In the first quarter, Square's hardware sales benefited from unusual excitement surrounding the release of its first contactless reader.

Under generally accepted accounting principles, Square isn't profitable, and it may not be for some time. But on an adjusted basis, Square's business is showing signs of improvement. During the second quarter, Square recorded an adjusted EBITDA gain of $13 million, up from just $1 million in the second quarter last year.

New products help drive software revenue, while loan growth explodes

Square's improving profitability was driven, in part, by its software and services segment. Revenue from this business totaled $30 million in the second quarter, up 130% on an annual basis, and up 25% from the first quarter. Square launched a number of new products, including Scheduled Invoices, Recurring Invoices, and Card on File in the second quarter, and also saw increased adoption of its existing products.

Square Capital remains a key driver of this segment. In the second quarter, Square extended $189 million worth of loans to its partners, up 123% annually, and up 23% on a sequential basis. Square's management has long argued that it's uniquely positioned to offer loans to small businesses, as it faces few customer acquisition costs and has intimate data on the health of the businesses it's lending to. Although Square Capital remains a small part of Square's overall business, it's played a key role in driving investor interest in the company, and its strength in the second quarter may be a key reason behind Square's rising share price.

Raising guidance for the year

Management is optimistic that Square's business will remain strong for the rest of the year. Square believes its total net revenue will come in between $1.63 billion and $1.67 billion in 2016, while adjusted revenue falls between $655 million and $670 million. Square had not previously given guidance for its 2016 total net revenue, but its outlook for adjusted revenue represents a notable increase from May, when it had forecast between $615 million and $635 million.

Overall, it was a strong second quarter for Square, and the rally in Square shares seems justified.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.