BEIJING—China courted the European Union as an ally in its trade conflict with the U.S., offering to improve access for foreign companies and work with the EU on reforming the World Trade Organization.

At an annual summit on Monday, China gave EU leaders much of what they were looking for. Both sides committed to setting up a working group to look at a WTO revamp, made headway in reaching an investment treaty and pledged to cooperate on enforcing the Paris accord on climate change.

Chinese...