A pair of Tesla electric vehicles sit outside the company’s showroom in Shanghai. The auto maker has come to an agreement with the Shanghai government to open a manufacturing facility in the city’s free-trade zone, according to people familiar with the plan. PHOTO: QILAI SHEN/BLOOMBERG. Electric-car maker Tesla Inc. TSLA -1.91% has reached an agreement to set up its own manufacturing facility in Shanghai, according to people briefed on the plan, a move that could help the company gain traction in China’s fast-growing EV market. The deal with Shanghai’s government will allow the Silicon Valley auto maker to build a wholly owned factory in the city’s free-trade zone, these people said. This arrangement, the first of its kind for a foreign auto maker, could enable Tesla to slash production costs, but it would still likely incur China’s 25% import tariff. Tesla is currently working with the Shanghai government about details of the de...