Shares of Square (NYSE:SQ) surprised just about everyone last year. Quarter after quarter, the company reported earnings results that exceeded expectations, ultimately sending the stock up more than 150% by the end of 2017.

A lot of things were working in Square's favor last year, as it seems nearly everything it invested in paid off better than expected. At the beginning of the year, CFO Sarah Friar guided for EBITDA margin expansion in the mid-single-digit percentage points. The company exceeded that guidance in each of the first three quarters.

Here's why 2017 was a year to remember for Square.

A person using a Square Stand to pay.

Image source: Square.

European invasion

Square expanded to Europe in 2017 when it landed in the United Kingdom in April. The U.K. is just the first stop on Square's European tour, according to CEO Jack Dorsey.

That said, the company has been very conservative in its investments in the region. International markets accounted for just 4% of revenue through the first nine months of 2017. Growth did accelerate slightly in the third quarter, reaching 4.5%, and Friar expects "ongoing momentum" from its international markets.

The U.K is the perfect market for Square to start in Europe. Small businesses account for over 99% of all private-sector businesses in the region. But Square faces incumbent local competitors as well as some familiar U.S.-based rivals in the market. Its ability to make inroads will require significant marketing spend.

A square-shaped bank

In September, Square took a major step when it submitted an application for a bank charter. Becoming a full-fledged bank will enable Square to originate more loans through its Square Capital program.

Square Capital facilitated 47,000 loans in the third quarter, totalling over $300 million. It's growing quickly, too, up 45% year over year.https://s2 Square currently works with Celtic bank to originate those loans, but becoming a full-fledged bank would enable Square to hold the paper and generate more profits from its customers. It also means greater risk, but Square thinks it can mitigate that risk by using its merchant data to determine how creditworthy its customers are.

Becoming a full-fledged bank also provides new ways for Square to bring customers into its ecosystem. The ecosystem is essential for Square to protect itself from competition and retain customers.

Winning big business

Another notable point of Square's 2017 was its performance with large sellers. More than 20% of gross payment volume on Square's platform came from large sellers (defined as annual GPV greater than $500,000) in the third quarter. That's up from 14% in the third quarter of 2016.

Even as Square courts more large sellers, its take rate remained stable at just under 3%. Square does have custom pricing for sellers of a certain size, offering better rates than its smaller customers. But Square has offset those discounts with increased volume from services like invoices, virtual terminal, and its e-commerce API, all of which have higher take rates than card-present transactions.

Large sellers are also more likely to take advantage of Square's other services, like its payroll and inventory management software, which enable it to upsell more easily and offset the costs of custom pricing. As mentioned, those services also help retain the business of those merchants.

A good start for 2018

2017 was a great year for Square stock, and 2018 is already off to a strong start, with the share price up over 30%. Whether Square maintains that momentum throughout the rest of the year will rely on whether its investments in new products and services as well as its geographic expansion keep paying off.

Shares are now trading back around Square's all-time high, which makes the stock a risky investment. But if you want in on the explosion in fintech over the last couple years, Square is one of the leaders in the space and offers an attractive growth story.

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.