<?xml version="1.0" encoding="us-ascii"?><InstanceReport xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Version>2.4.0.8</Version><ReportLongName>0014 - Disclosure - 9. ACCOUNTS PAYABLE AND ACCRUED LIABILITIES</ReportLongName><DisplayLabelColumn>true</DisplayLabelColumn><ShowElementNames>false</ShowElementNames><RoundingOption /><HasEmbeddedReports>false</HasEmbeddedReports><Columns><Column FlagID="0"><Id>1</Id><IsAbstractGroupTitle>false</IsAbstractGroupTitle><LabelSeparator>

</LabelSeparator><CurrencyCode /><FootnoteIndexer /><hasSegments>false</hasSegments><hasScenarios>false</hasScenarios><MCU><KeyName /><CurrencySymbol /><contextRef><ContextID>From2013-01-01to2013-03-31</ContextID><EntitySchema>http://www.sec.gov/CIK</EntitySchema><EntityValue>0001075773</EntityValue><PeriodDisplayName /><PeriodType>duration</PeriodType><PeriodStartDate>2013-01-01T00:00:00</PeriodStartDate><PeriodEndDate>2013-03-31T00:00:00</PeriodEndDate><Segments /><Scenarios /></contextRef><UPS /><CurrencyCode /><OriginalCurrencyCode /></MCU><CurrencySymbol /><Labels><Label Key="CalendarSupplement" Id="0" Label="3 Months Ended" /><Label Key="Calendar" Id="1" Label="Mar. 31, 2013" /></Labels></Column></Columns><Rows><Row FlagID="0"><Id>1</Id><IsAbstractGroupTitle>true</IsAbstractGroupTitle><LabelSeparator>

</LabelSeparator><Level>1</Level><ElementName>us-gaap_PayablesAndAccrualsAbstract</ElementName><ElementPrefix>us-gaap_</ElementPrefix><IsBaseElement>true</IsBaseElement><BalanceType>na</BalanceType><PeriodType>duration</PeriodType><IsReportTitle>false</IsReportTitle><IsSegmentTitle>false</IsSegmentTitle><IsCalendarTitle>false</IsCalendarTitle><IsEquityPrevioslyReportedAsRow>false</IsEquityPrevioslyReportedAsRow><IsEquityAdjustmentRow>false</IsEquityAdjustmentRow><IsBeginningBalance>false</IsBeginningBalance><IsEndingBalance>false</IsEndingBalance><IsReverseSign>false</IsReverseSign><FootnoteIndexer /><Cells><Cell FlagID="0" ContextID="" UnitID=""><Id>1</Id><IsNumeric>false</IsNumeric><IsRatio>false</IsRatio><DisplayZeroAsNone>false</DisplayZeroAsNone><NumericAmount>0</NumericAmount><RoundedNumericAmount>0</RoundedNumericAmount><NonNumbericText /><FootnoteIndexer /><CurrencyCode /><CurrencySymbol /><IsIndependantCurrency>false</IsIndependantCurrency><ShowCurrencySymbol>false</ShowCurrencySymbol><DisplayDateInUSFormat>false</DisplayDateInUSFormat></Cell></Cells><ElementDataType>xbrli:stringItemType</ElementDataType><SimpleDataType>string</SimpleDataType><IsTotalLabel>false</IsTotalLabel><UnitID>0</UnitID><Label>Payables and Accruals [Abstract]</Label></Row><Row FlagID="0"><Id>2</Id><IsAbstractGroupTitle>false</IsAbstractGroupTitle><LabelSeparator>

</LabelSeparator><Level>2</Level><ElementName>us-gaap_AccountsPayableAndAccruedLiabilitiesDisclosureTextBlock</ElementName><ElementPrefix>us-gaap_</ElementPrefix><IsBaseElement>true</IsBaseElement><BalanceType>na</BalanceType><PeriodType>duration</PeriodType><IsReportTitle>false</IsReportTitle><IsSegmentTitle>false</IsSegmentTitle><IsCalendarTitle>false</IsCalendarTitle><IsEquityPrevioslyReportedAsRow>false</IsEquityPrevioslyReportedAsRow><IsEquityAdjustmentRow>false</IsEquityAdjustmentRow><IsBeginningBalance>false</IsBeginningBalance><IsEndingBalance>false</IsEndingBalance><IsReverseSign>false</IsReverseSign><FootnoteIndexer /><Cells><Cell FlagID="0" ContextID="From2013-01-01to2013-03-31" UnitID=""><Id>1</Id><IsNumeric>false</IsNumeric><IsRatio>false</IsRatio><DisplayZeroAsNone>false</DisplayZeroAsNone><NumericAmount>0</NumericAmount><RoundedNumericAmount>0</RoundedNumericAmount><NonNumbericText>&lt;p style="font: 8pt/normal Times New Roman, Times, Serif; margin: 0"&gt;Accounts payable and accrued liabilities at March 31, 2013
and December 31, 2012 consist of the following:&lt;/p&gt;

&lt;p style="font: 8pt/normal Times New Roman, Times, Serif; margin: 0"&gt;&amp;#160;&lt;/p&gt;

&lt;table cellspacing="0" cellpadding="0" style="font: 8pt Calibri, Helvetica, Sans-Serif; width: 100%"&gt;
&lt;tr style="vertical-align: bottom"&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td colspan="2" style="border-bottom: black 1pt solid; text-align: center; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;b&gt;03/31/13&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td colspan="2" style="border-bottom: black 1pt solid; text-align: center; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&lt;b&gt;12/31/12&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; background-color: #CCEEFF"&gt;
    &lt;td style="width: 78%; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;Trade accounts payable&lt;/font&gt;&lt;/td&gt;
    &lt;td style="width: 1%; text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="width: 1%; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;$&lt;/font&gt;&lt;/td&gt;
    &lt;td style="width: 8%; text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;850,411&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="width: 1%; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="width: 1%; text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="width: 1%; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;$&lt;/font&gt;&lt;/td&gt;
    &lt;td style="width: 8%; text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;799,512&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="width: 1%; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; background-color: white"&gt;
    &lt;td style="line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;Accrued payroll&lt;/font&gt;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;30,548&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;15,000&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; background-color: #CCEEFF"&gt;
    &lt;td style="line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;Accrued payable to vendors&lt;/font&gt;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;47,075&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;32,075&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; background-color: white"&gt;
    &lt;td style="line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;Accrued interest&lt;/font&gt;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;85,964&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;140,064&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; background-color: #CCEEFF"&gt;
    &lt;td style="line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;Royalties payable&lt;/font&gt;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;48,120&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;33,120&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; background-color: white"&gt;
    &lt;td style="line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;Bank Overdraft&lt;/font&gt;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;1,246&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;-&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; background-color: #CCEEFF"&gt;
    &lt;td style="line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;Liabilities associated with our reverse merger in December, 2008&lt;/font&gt;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;200,380&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;200,380&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; background-color: white"&gt;
    &lt;td style="line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;Due to AFEC&lt;/font&gt;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;120,000&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;120,000&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; background-color: #CCEEFF"&gt;
    &lt;td style="line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;All-Secure payable&lt;/font&gt;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="border-bottom: black 1pt solid; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="border-bottom: black 1pt solid; text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;17,473&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="border-bottom: black 1pt solid; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="border-bottom: black 1pt solid; text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;&amp;#160;17,473&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="vertical-align: bottom; background-color: white"&gt;
    &lt;td style="line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;Total&lt;/font&gt;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="border-bottom: black 1.5pt double; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;$&lt;/font&gt;&lt;/td&gt;
    &lt;td style="border-bottom: black 1.5pt double; text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;1,401,217&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="text-align: right; line-height: 115%"&gt;&amp;#160;&lt;/td&gt;
    &lt;td style="border-bottom: black 1.5pt double; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;$&lt;/font&gt;&lt;/td&gt;
    &lt;td style="border-bottom: black 1.5pt double; text-align: right; line-height: 115%"&gt;&lt;font style="font: 8pt Times New Roman, Times, Serif"&gt;1,357,624&lt;/font&gt;&lt;/td&gt;
    &lt;td nowrap="nowrap" style="line-height: 115%"&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p style="font: 8pt/normal Times New Roman, Times, Serif; margin: 0; text-indent: 0.5in"&gt;&amp;#160;&lt;/p&gt;

&lt;p style="font: 8pt/normal Times New Roman, Times, Serif; margin: 0"&gt;As of&amp;#160;&amp;#160;March 31, 2013 and December 31, 2012, the
Company owed four related parties a combined liability of $165,976&amp;#160;&amp;#160;and $74,000 for accrued consulting fees.&lt;/p&gt;

&lt;p style="font: 8pt/normal Times New Roman, Times, Serif; margin: 0; text-indent: 0.5in"&gt;&amp;#160;&lt;/p&gt;</NonNumbericText><FootnoteIndexer /><CurrencyCode /><CurrencySymbol /><IsIndependantCurrency>false</IsIndependantCurrency><ShowCurrencySymbol>false</ShowCurrencySymbol><DisplayDateInUSFormat>false</DisplayDateInUSFormat></Cell></Cells><ElementDataType>nonnum:textBlockItemType</ElementDataType><SimpleDataType>na</SimpleDataType><ElementDefenition>The entire disclosure for accounts payable and accrued liabilities at the end of the reporting period.</ElementDefenition><ElementReferences>Reference 1: http://www.xbrl.org/2003/role/presentationRef

 -Publisher SEC

 -Name Regulation S-X (SX)

 -Number 210

 -Section 02

 -Paragraph 19

 -Subparagraph a

 -Article 5



Reference 2: http://www.xbrl.org/2003/role/presentationRef

 -Publisher FASB

 -Name Accounting Standards Codification

 -Topic 210

 -SubTopic 10

 -Section S99

 -Paragraph 1

 -Subparagraph (SX 210.5-02.19(a),20,24)

 -URI http://asc.fasb.org/extlink&amp;oid=6877327&amp;loc=d3e13212-122682



Reference 3: http://www.xbrl.org/2003/role/presentationRef

 -Publisher SEC

 -Name Regulation S-X (SX)

 -Number 210

 -Section 02

 -Paragraph 20, 24

 -Article 5



</ElementReferences><IsTotalLabel>false</IsTotalLabel><UnitID>0</UnitID><Label>ACCOUNTS PAYABLE AND ACCRUED LIABILITIES</Label></Row></Rows><Footnotes /><IsEquityReport>false</IsEquityReport><ReportName>9. ACCOUNTS PAYABLE AND ACCRUED LIABILITIES</ReportName><MonetaryRoundingLevel>UnKnown</MonetaryRoundingLevel><SharesRoundingLevel>UnKnown</SharesRoundingLevel><PerShareRoundingLevel>UnKnown</PerShareRoundingLevel><ExchangeRateRoundingLevel>UnKnown</ExchangeRateRoundingLevel><HasCustomUnits>true</HasCustomUnits><IsEmbedReport>false</IsEmbedReport><IsMultiCurrency>false</IsMultiCurrency><ReportType>Sheet</ReportType><RoleURI>http://treatyenergy.com/role/AccountsPayableAndAccruedLiabilities</RoleURI><NumberOfCols>1</NumberOfCols><NumberOfRows>2</NumberOfRows></InstanceReport>
