Image source: Stillwater Mining.

What: Stillwater Mining Company's (SWC) shares rose just over 17% last month. That brings the gain through the first six months of 2016 to around 39%. A lot of hard work set this up, but the big gains came in the last week of June -- here's the story.  

So what: Like all miners, Stillwater has been forced to cut back on what it spends because of weak commodity prices. For example, between the first quarter of 2015 and the first quarter of 2016, the company's all-in sustaining costs for producing platinum and palladium fell nearly 20% to roughly $613 an ounce. The company thinks it can push costs even lower, too. So this is a bit of good news. But alone, it can only do just so much for the top and bottom lines and the share price.  

Indeed, the company's realized price for the metals it brings up was $612 an ounce in the first quarter. That means the miner is getting close but isn't there just yet. Its realized price, for reference, fell nearly 30% year over year, so the commodity market has still been working against the miner.

At least until the last few days of June. Platinum was up roughly 4.7% in the final two days of the month, and palladium rallied nearly 9.7% over the last five days of the month. With only a dollar difference between what it cost to mine an ounce of metal and what it gets paid for the metal at the end of the first quarter, Stillwater's prospects just got a lot better. That helps explain the late month rally after a pretty lackluster month in terms of share price; over the last three days of June, the stock rocketed nearly 15% higher, accounting for most of the monthly gain.  

Now what: Stillwater is one of the few ways investors can invest directly in a platinum group miner. And it's a fairly well-run company, with more cash on hand than debt and a clear emphasis on containing costs. If the recent rally in platinum and palladium holds, investors should be expecting improving news out of the miner in the second half. If you're positive on the outlook for the platinum group, you should take a deeper dive here.