SAN FRANCISCO — Venture-capital titan John Doerr, once one of Ellen Pao’s biggest supporters, looked pained in court Tuesday as he defended his part in decisions to leave Pao off a company board, pass her over for a promotion and ultimately fire her.

Doerr hired Pao at Silicon Valley firm Kleiner Perkins Caufield & Byers in 2005 to help him with administrative duties as part of what insiders called “Team JD.” Pao sued Kleiner Perkins for gender discrimination in 2012, claiming the firm refused to promote her to senior investing partner because she is a woman and retaliated against her for complaining about sexual advances by male partners.