Water environment system is a complex system, and an agent-based model presents an effective approach that has been implemented in water resource management research. Urban water resource optimal allocation is a challenging and critical issue in water environment systems, which belongs to the resource optimal allocation problem. In this paper, a novel approach based on multiagent Q-learning is proposed to deal with this problem. In the proposed approach, water users of different regions in the city are abstracted into the agent-based model. To realize the cooperation among these stakeholder agents, a maximum mapping value function-based Q-learning algorithm is proposed in this study, which allows the agents to self-learn. In the proposed algorithm, an adaptive reward value function is used to improve the performance of the multiagent Q-learning algorithm, where the influence of multiple factors on the optimal allocation can be fully considered. The proposed approach can deal with various situations in urban water resource allocation. The experimental results show that the proposed approach is capable of allocating water resource efficiently and the objectives of all the stakeholder agents can be successfully achieved.