Twitter Inc. has named its first chief operating officer since Chief Executive Officer Dick Costolo vacated the role two years ago, as the social site bolsters its leadership team ahead of a possible initial public offering.

Ali Rowghani, who had served as chief financial officer since early 2010, has been appointed COO, Costolo wrote in a post on the site yesterday. Mike Gupta, who joined last month after leaving Zynga Inc., has been named CFO, Costolo wrote.

The move frees Rowghani, whose broad range of responsibilities already included partnerships and global expansion, to focus on growth and increasing competition with social-network rivalFacebook Inc.

As CFO, Gupta will lead preparations for an eventual IPO, which may be one of the most anticipated offerings of the next few years.

Rowghani played a key role in lining up the venture capital round from DST Global and other existing investors that valued San Francisco-based Twitter at about $8 billion last year.

The executive has been vocal in internal debates such as whether to form a partnership or joint venture with a local company to help lure users in Japan. Rowghani pushed for the company to stay independent to retain control over its future, a person with knowledge of the deliberations said earlier this year. Rowghani’s view prevailed.

Rowghani previously worked at Walt Disney Co.’s Pixar, where he was CFO and a close colleague of Apple Inc. co-founder and Pixar leader Steve Jobs.