Tesla has long been called the Apple of automakers for its alternative approach, its rampant fan base, and its Silicon Valley roots. But the interest could go deeper.

Financial analyst Craig Irwin of Roth Capital Partners revealed Tuesday that Apple tried to buy Tesla in 2013, but was rebuffed. He said that the tech company bid $240 a share for Tesla at the time, a price significantly higher than where Tesla stock has traded this week, after a recent slump since the beginning of the year. Tesla stock closed at $205.08 Tuesday.

READ THIS: Apple will build electric cars by 2020: Tesla's Elon Musk 

“If Apple had interest then, they would probably have interest now at the right price,” Irwin told CNBC.

Apple is in the process of repatriating its nearly $250 billion cash hoard held overseas in response to tax-law changes, and may be looking for ways to invest that money. The company has said it expects to spend $30 billion on local job-creating investments. CNBC notes that Tesla's current market cap is about $36 million.

CHECK OUT: Apple Electric Car Is "Committed Project," To Ship In 2019: Report (2015)

Tesla could be a plum for Apple, which has been working on its own self-driving program on and off since 2014, and has traded software engineers back and forth with Tesla for years. Carl Icahn, a prominent Apple investor, has said the company views cars as "the ultimate mobile device."

What Apple's program has always lacked, of course, is a car. Apple has said it is no longer working on developing a car of its own, but is focusing on self-driving software. Tesla could not only provide a car (or three), but has a substantially developed self-driving system of its own. Tesla's cars and Full Self-Driving software might help give Apple an entry into the self-driving car business.

DON'T MISS: Big investment not enough for long term at Tesla, Musk says: report

After Tesla ran into a sales slump in the first quarter, it could use the money. CEO Elon Musk said the company would be reviewing every expense looking for cuts, and said the new cash could last as little at 10 months. It is building a new factory in China and has four new models in the works in the next two years, including the Model Y SUV, the second-generation Roadster, the Semi, and finally a pickup truck.