We use the share pledge context in China to examine how affiliated analysts whose securities companies are pledgees of share pledge firms issue stock recommendations on these listed firms. We find that their recommendations are more optimistic than those of non-affiliated analysts, and they are more likely to issue Buy and Add recommendations, suggesting that they issue optimistic rating reports for share pledge firms due to their conflicts of interest. We also find a dynamic adjustment in the stock recommendation behavior of these analysts, and their probability after issuing optimistic stock recommendations is significantly reduced before and after the years that the affiliation relationship between them and share pledge firms both began and ended. These affiliated analysts continue to issue optimistic stock recommendations after visiting the share pledge firms if they work in the same location as the firms, or if they are star analysts among New Fortune’s “top five analysts,” and when the information transparency of the share pledge firms is higher. In addition, the optimistic stock recommendation behavior of affiliated analysts is more significant in our sample of firms with high share pledge ratios and downward stock price pressure. The earnings forecast quality of affiliated analysts is also found to be lower, and they are less inclined to downgrade stock recommendations for these share pledge firms. Buy recommendations issued by both non-affiliated and affiliated analysts can bring cumulative excess returns in the short event window, but those issued by affiliated analysts are significantly negative in the long-term event window, and significantly lower than those issued by non-affiliated analysts. Overall, our study shows that affiliated analysts issue optimistic rating reports on share pledge firms due to conflicts of interest, which leads to decision-making bias in investors and thus decreases the stock price crash risk of the firms. Our findings further reveal the economic consequences of share pledging and extend our understanding of the behavior of analysts in a conflict of interest situation from the share pledge perspective.