New York (CNN Business) Tesla rattled investors on Wednesday by reporting profit that fell short of expectations and revealing that its chief financial officer is leaving — the latest senior executive to exit the electric car company.

CEO Elon Musk said on an earnings call Wednesday that CFO Deepak Ahuja is retiring. Ahuja had returned to the company less than two years ago after its previous CFO unexpectedly quit.

Musk said that Ahuja's retirement will not be immediate, and that he will continue to serve as a senior adviser to the company. Zach Kirkhorn, the company's current vice president of finance, will replace him as CFO.

He'll inherit a profitable company. Tesla on Wednesday reported net profit of $139 million for the three months ended in December, its second consecutive quarter in the black.

Read More